Ubiquity tab count
I've been looking for ages for an easy way to show the number of tabs I have open without needing an extension.
(The problem is that Greasemonkey and such don't get access to the browser chrome, whereas extensions do)
Well, I compromised by installing Ubiquity.
Now an alt-space, 'tabs', will show "n tabs in m windows".
Here's the script:
(The problem is that Greasemonkey and such don't get access to the browser chrome, whereas extensions do)
Well, I compromised by installing Ubiquity.
Now an alt-space, 'tabs', will show "n tabs in m windows".
Here's the script:
CmdUtilsCreateCommand
name: 'tabs'
description: 'Count the number of tabs and windows you have open'
icon: 'http://www.spreadfirefox.com/files/spreadfirefox_RCS_favicon.png'
author: name: 'Joshua May'email: 'notjosh@gmail.com'
homepage: 'http://notjosh.com/'
var wm = Componentsclasses'@mozilla.org/appshell/window-mediator;1'getServiceComponentsinterfacesnsIWindowMediator;
var counts = this_countwm;
var messageTemplate = '${tabs} tab${tabPlural} open in ${windows} window${windowPlural}';
displayMessageCmdUtilsrenderTemplatemessageTemplate
'tabs': countstab
'windows': countswindow
'tabPlural': 1 != countstab ? 's' : ''
'windowPlural': 1 != countswindow ? 's' : ''
;
var windowIterator = wmgetEnumerator'navigator:browser';
var window;
var counts =
window: 0
tab: 0
;
while windowIteratorhasMoreElements
window = windowIteratorgetNext;
countswindow++;
countstab += windowdocumentgetElementById'content'mTabslength;
return counts;
;