Skip to content

Instantly share code, notes, and snippets.

@fupslot
Created November 21, 2012 16:51
Show Gist options
  • Save fupslot/4125997 to your computer and use it in GitHub Desktop.
Save fupslot/4125997 to your computer and use it in GitHub Desktop.
Chrome: Get Tabs
var w = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var win = w.getMostRecentWindow("navigator:browser");
for (var i = win.gBrowser.tabs.length - 1; i >= 0; i--) {
var browser = win.gBrowser.tabs[i].linkedBrowser;
var cd = browser.contentDocument;
var cw = browser.contentWindow;
var url = browser.currentURI.spec;
var favIcon = browser.mIconURL;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment