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

getTabForId

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.getTabForId() retrieves a browser tab, given its unique ID.

Syntax

var tab = window.getTabForId(id);

id
The tab's unique ID, which can be found as the id property of the Tab object.

Returns

tab: the Tab corresponding to this ID.

Example

This function returns the title of the document hosted by a tab, given the tab's ID:

function tabTitle(id) {
  let tab = window.BrowserApp.getTabForId(id);
  return tab.window.document.title;
}

See Also

Document Tags and Contributors

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