about:benjie

Random learnings and other thoughts from an unashamed geek

Ever Wondered How Many Firefox Tabs You Have Open?

| Comments

Mozilla Firefox Icon

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?

Comments