Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/pageaction/getpopup/index.md
6580 views
------{{AddonSidebar()}}
Gets the URL for the HTML document set as the popup for this page action.
This is an asynchronous function that returns a Promise.
Syntax
Parameters
details:
object.tabId:
integer. ID of the tab whose popup you want to get.
Return value
A Promise that will be fulfilled with a string containing the popup's URL.
Browser compatibility
{{Compat}}
Examples
Add a context menu item that logs the popup URL for the current tab. Note that you'll need the contextMenus permission in your manifest to create context menu items.
{{WebExtExamples}}
Note: This API is based on Chromium's
chrome.pageActionAPI. This documentation is derived frompage_action.jsonin the Chromium code.