Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

getTabForBrowser

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.getTabForBrowser() retrieves a tab, given the XUL browser object hosted by that tab.

Syntax

var tab = window.getTabForBrowser(browser);

browser
The browser object hosted by this tab, which can be found as the browser property of the Tab object.

Returns

tab: the Tab corresponding to this browser.

Example

This function returns the ID of a tab, given the tab's browser:

function tabID(browser) {
  let tab = window.BrowserApp.getTabForBrowser(browser);
  return tab.id;
}

See Also

Document Tags and Contributors

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