Mozilla's getting a new look. What do you think? https://mzl.la/brandsurvey

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,