-
-
Save erikvold/1020051 to your computer and use it in GitHub Desktop.
Simple Window + Tab Stats
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
// Run this in your error console | |
var wc=0, tc=0; | |
var wm = window.top.opener.Services.wm; | |
var e = wm.getEnumerator("navigator:browser"); | |
var uc = { }; | |
while (e.hasMoreElements()) { | |
var tabs = e.getNext().gBrowser.tabs; | |
wc+=1; | |
tc += tabs.length; | |
Array.forEach(tabs, function(t) { | |
var url = t.linkedBrowser.currentURI.spec; | |
if (!(url in uc)) { | |
uc[url] = 0; | |
} | |
uc[url]++; | |
}); | |
} | |
var s = "Open windows: " + wc + "\nOpen tabs: " + tc + "\nDuplicated urls:\n"; | |
for ([u,c] in Iterator(uc)) { | |
if (c > 1) { | |
s += " " + c + " - " + u + "\n"; | |
} | |
} | |
s; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment