Ever Wondered How Many Firefox Tabs You Have Open?
To find out, open Tools > Error Console, and copy and paste this lump of javascript into the “code” box and press enter:
javascript:var w=Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getEnumerator('navigator:browser'),t=0;while(w.hasMoreElements())t+=w.getNext().document.getElementById("content").mTabs.length;alert("You have "+t+" tabs open");
I’ve just closed 48 tabs, and found that there was still loads of tabs open (and I didn’t want to continue counting) so I wrote this code (inspired by Open Tab Count firefox extension) and found I had 77 still open! For those of you who’s mental arithmetic is poor, that’s a total of 125 tabs! And firefox 3 still runs really smoothly with little delay when changing tabs, and my system is using less than 2 GB of it’s available 4GB of RAM. Now, I think that’s pretty impressive, and would like to see Google Chrome compete with that with it’s one-process-per-tab design! (If only FF3s JS was as fast…)
Whilst I am talking about browsers, I feel I should moan that Flash 10 for GNU/Linux is still really unstable, I have to restart firefox a couple of times a day because it’s audio gets corrupted or it stops working and just displays a white box in firefox. If only I could restart flash without restarting firefox… Can I do that?
Related articles by Zemanta
Tags: Adobe Flash, JavaScript, Mozilla Firefox 3, Tab

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_c.png?x-id=3c6b13d5-6170-4311-9dbd-1569799d4bb7)
September 9th, 2008 at 5:04 pm
It’s not just Flash 10 - it’s Flash 9 in FF3 also. I think it’s an FF3 issue.
September 12th, 2008 at 7:27 am
re: Flash10, there are 32bit versions of nspluginwrapper (the wrapper that allows the use of 32bit plug-ins on 64bit installs) around which will do the job nicely. While installed, if flash crashes, you’ll get a gray box instead of having Firefox close up on you. At that point, going to add-ons and disabling/re-enabling flash will bring it back without a restart.
re: Javascript blurb, you’ve got “’s, ”’s and ’’s mixed into that code, which breaks it.
javascript:var w=Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getEnumerator(’navigator:browser’),t=0;while(w.hasMoreElements())t+=w.getNext().document.getElementById(”content”).mTabs.length;alert(”You have “+t+” tabs open”);
September 12th, 2008 at 7:28 am
Ah, neat, it’s just your website that breaks it :p
September 12th, 2008 at 8:59 am
cwillu, thanks for the heads up, the code is now fixed in the website. Re: the disabling/re-enabling of flash through add-ons - I never knew that! Thanks so much! (I assumed you’d have to restart firefox to get the benefit, as with add-ins.)