Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

getTabForWindow

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 the Tab 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;
}

See Also

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,