Gets the HTML document set as the popup for this browser action.
This is an asynchronous function that returns a Promise
.
Gets the HTML document set as the popup for this browser action.
This is an asynchronous function that returns a Promise
.
let gettingPopup = browser.browserAction.getPopup( details // object )
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.
windowId
and tabId
are both supplied, the function fails.windowId
and tabId
are both omitted, the global popup is returned.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
.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
getPopup |
Yes
|
79
|
45
|
?
|
Yes
|
14
|
?
|
?
|
57
|
?
|
15
|
?
|
details_windowId_parameter |
No
|
No
|
62
|
?
|
No
|
No
|
?
|
?
|
No
|
?
|
No
|
?
|
Get the popup's URL:
function gotPopup(popupURL) { console.log(popupURL) } let gettingPopup = browser.browserAction.getPopup({}); gettingPopup.then(gotPopup);
Note: This API is based on Chromium's chrome.browserAction
API. This documentation is derived from browser_action.json
in the Chromium code.
Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
© 2005–2022 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction/getPopup