getBrowserForDocument

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.getBrowserForDocument() retrieves a browser, given the DOM document hosted by that browser.

Syntax

var browser = window.BrowserApp.getBrowserForDocument(document);

document
The DOM document object hosted by this browser's DOM window, which can be found as the contentWindow property of the browser object.

Returns

browser: the browser which hosts the given DOM document.

Example

This code retrieves the browser for document, and calls its goBack() method.

  let browser = window.BrowserApp.getBrowserForDocument(document);
  browser.goBack();

See Also

Document Tags and Contributors

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