browserAction.getPopup()

Gets the HTML document set as the popup for this browser action.

This is an asynchronous function that returns a Promise.

Syntax

js
let gettingPopup = browser.browserAction.getPopup(
  details               // object
)

Parameters

details

An object with the following properties:

tabId Optional

integer. The tab whose popup to get.

windowId Optional

integer. The windows whose popup to get.

  • If windowId and tabId are both supplied, the function fails.
  • If windowId and tabId are both omitted, the global popup is returned.

Return value

A Promise that will be fulfilled with a string containing the URL for the popup's document. This will be a fully qualified URL, such as moz-extension://d1d8a2eb-fe60-f646-af30-a866c5b39942/popups/popup2.html.

Examples

Get the popup's URL:

js
function gotPopup(popupURL) {
  console.log(popupURL);
}

let gettingPopup = browser.browserAction.getPopup({});
gettingPopup.then(gotPopup);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getPopup
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 57 (Release date: 2017-11-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
details.windowId parameter
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 62 (Release date: 2018-09-05)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Note: This API is based on Chromium's chrome.browserAction API. This documentation is derived from browser_action.json in the Chromium code.