action.getPopup()

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

Note: This API is available in Manifest V3 or higher.

This is an asynchronous function that returns a Promise.

Syntax

js
let gettingPopup = browser.action.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.action.getPopup({});
gettingPopup.then(gotPopup);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getPopup
Chrome – Full support
Chrome 88 (Release date: 2021-01-19)
footnote Full support
Edge – Full support
Edge 88 (Release date: 2021-01-21)
footnote Full support
Firefox – Full support
Firefox 109 (Release date: 2023-01-17)
footnote Full support
Opera – Full support
Opera 74 (Release date: 2021-02-02)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Firefox for Android – Full support
Firefox for Android 109 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
details.windowId parameter
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 109 (Release date: 2023-01-17)
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 109 (Release date: 2023-01-17)
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.action API. This documentation is derived from browser_action.json in the Chromium code.