browserAction.getPopup()
Gets the HTML document set as the popup for this browser action.
This is an asynchronous function that returns a Promise
.
Syntax
var gettingPopup = browser.browserAction.getPopup(
details // object
)
Parameters
details
object
.-
tabId
Optionalinteger
. The tab whose popup to get.windowId
Optionalinteger
. The windows whose popup to get.
- If
windowId
andtabId
are both supplied, the function fails. - If
windowId
andtabId
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 qualifed URL, such as moz-extension://d1d8a2eb-fe60-f646-af30-a866c5b39942/popups/popup2.html
.
Browser compatibility
Report problems with this compatibility data on GitHubwebextensions-desktop | webextensions-mobile | |||||
---|---|---|---|---|---|---|
getPopup | ChromeFull supportYes | EdgeFull support79 | FirefoxFull support45 | OperaFull supportYes | SafariFull support14 | Firefox for AndroidFull support57 |
Legend
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Examples
Get the popup's URL:
function gotPopup(popupURL) {
console.log(popupURL)
}
var gettingPopup = browser.browserAction.getPopup({});
gettingPopup.then(gotPopup);
Acknowledgements
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.