action.openPopup()

Open the browser action's popup.

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

Syntax

js
browser.action.openPopup(
  options // optional object
)

Parameters

details Optional

An object with these properties:

windowId Optional

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 with focused: 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:

js
browser.menus.create({
  id: "open-popup",
  title: "open popup",
  contexts: ["all"],
});

browser.menus.onClicked.addListener(() => {
  browser.action.openPopup();
});

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
openPopup
Chrome – No support
Chrome 118 – 126 (Release date: 2023-10-10)
footnote Between Chrome 118 and Chrome 126, was only available to policy installed extensions.
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – No support
Edge 118 – 126 (Release date: 2023-10-13)
footnote Between Edge 118 and Edge 126, was only available to policy installed extensions.
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – Full support
Firefox 109 (Release date: 2023-01-17)
footnote
footnote Before Firefox 149, a user gesture is required to call this API.
Opera – No support
Opera 104 – 112 (Release date: 2023-10-23)
footnote Between Opera 104 and Opera 112, was only available to policy installed extensions.
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – Full support
Safari 16 (Release date: 2022-09-12)
footnote Full support
Firefox for Android – Full support
Firefox for Android 109 (Release date: 2023-01-17)
footnote
footnote Before Firefox for Android 149, a user gesture is required to call this API.
Safari on iOS – Full support
Safari on iOS 16 (Release date: 2022-09-12)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.
Has more compatibility info.