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.


BrowserApp.addTab() opens a new tab. By default, the new tab is made the selected tab.


var tab = window.BrowserApp.addTab(uri);

var tab = window.BrowserApp.addTab(uri, params);

The URI to load into the tab, represented as a string.
An optional parameter which contains any of these properties:
  • pinned: boolean property, true if you want the new tab to be pinned as an app tab. Defaults to false.
  • selected: boolean property, true if you want the new tab to be made the selected tab. Defaults to true.
  • isPrivate New in Mobile 20: boolean property, true if you want the new tab to be opened in private browsing mode. [This editor's note: in my tests, defaulted to false]


tab: the new tab, represented as a Tab object.


This code implements a simple "View Source" add-on, using BrowserApp.addTab() to open a new tab displaying the current tab's source:

function viewSource(window) {
  window.BrowserApp.addTab("view-source:" + window.content.location.href);

var menuId;

function loadIntoWindow(window) {
  if (!window)
  menuId ="View Source", null, function() {

function unloadFromWindow(window) {
  if (!window)

This function opens the specified uri in a new tab, without selecting the tab:

function openUnselected(window, uri) {
  let params = {
    selected: false
  window.BrowserApp.addTab(uri, params);

See Also

Document Tags and Contributors

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