browserAction.openPopup()
Öffnet das Popup der Browser-Aktion.
In stabilen Versionen von Firefox kann diese Funktion nur innerhalb des Handlers für eine Benutzeraktion aufgerufen werden. Details finden Sie unter Browser-Kompatibilität.
Syntax
js
browser.browserAction.openPopup(
options // optional object
)
Parameter
details
Optional-
Ein Objekt mit den folgenden Eigenschaften:
windowId
Optional-
integer
. Fenster, für das das Popup geöffnet werden soll. Standardmäßig das aktuelle Fenster.
Rückgabewert
Ein Promise
, das ohne Argumente aufgelöst wird.
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
openPopup |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
- User must explicitly enable this feature.
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.
Beispiele
Öffnen Sie das Popup, wenn der Benutzer ein Kontextmenüelement auswählt:
js
browser.menus.create({
id: "open-popup",
title: "open popup",
contexts: ["all"],
});
browser.menus.onClicked.addListener(() => {
browser.browserAction.openPopup();
});