The BrowserApp object is only available to privileged code running on Firefox for Android, and is intended for use by Firefox for Android add-ons.
Summary
BrowserApp.getTabForWindow()
retrieves a browser tab, given the DOM window hosted by that tab.
Syntax
var tab = window.getTabForWindow(window);
window
- The content window object hosted by this tab, which can be found as the
window
property of theTab
object.
Returns
tab
: the Tab
corresponding to this content window.
Example
This function returns the ID of a tab, given the tab's window:
function tabID(window) { let tab = window.BrowserApp.getTabForWindow(window); return tab.id; }