action.openPopup()
Open the browser action's popup.
Open the browser action's popup.
[!NOTE] This API is available in Manifest V3 or higher.
Syntax
browser.action.openPopup(
options // optional object
)
Parameters
details- : An object with these properties:
windowId- :
integer. Window to open the popup in. Defaults to the focused (active) window. In Chrome and from Firefox 149, if the window ID is for an unfocused window, the API call is rejected. A window can be focused by calling windows.update withfocused: true.
Return value
A Promise that resolves with no arguments. If the popup isn't opened, rejects with an error message.
Examples
Open the popup when the user selects a context menu item:
browser.menus.create({
id: "open-popup",
title: "open popup",
contexts: ["all"],
});
browser.menus.onClicked.addListener(() => {
browser.action.openPopup();
});