Created
March 31, 2010 09:11
-
-
Save xulapp/350115 to your computer and use it in GitHub Desktop.
showTabsCountInTitlebar.uc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name showTabsCountInTitlebar.uc.js | |
// @description the tabs count is displayed in the end of the title string. | |
// @include main | |
// @compatibility Firefox 3.5+ | |
// @namespace http://twitter.com/xulapp | |
// @author xulapp | |
// @license MIT License | |
// @version 2011/04/03 15:40 +09:00 | |
// ==/UserScript== | |
// @version 2010/03/31 18:00 +09:00 | |
(function showTabsCountInTitlebar() { | |
eval('gBrowser.updateTitlebar = ' + gBrowser.updateTitlebar.toString().replace( | |
/\bthis\.ownerDocument\.title = [^;]+/g, | |
'$& + " [Tab: " + this.mTabs.length + "]"' | |
)); | |
document.addEventListener('TabClose', STC_onTabClose, false); | |
function updateTitlebar() { | |
gBrowser.updateTitlebar(); | |
} | |
function STC_onTabClose() { | |
clearTimeout(STC_onTabClose.timer); | |
STC_onTabClose.timer = setTimeout(updateTitlebar, 0); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment