Created
July 25, 2011 15:12
-
-
Save waltz/1104353 to your computer and use it in GitHub Desktop.
How to get a Tab with a Browser in a Firefox Addon/Extension
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
function getTabFromBrowser(browser) | |
{ | |
var tab_container = gBrowser.tabContainer; | |
var browser_panel = browser.parentNode.parentNode; | |
for (var i = 0; i < tab_container.itemCount; i++) | |
{ | |
var tab = tab_container.getItemAtIndex(i); | |
if (tab.linkedPanel == browser_panel.id) | |
{ | |
return tab; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment