action.openPopup()
语法
js
browser.action.openPopup(
options // 可选的对象
)
参数
details
可选-
一个含有下列属性的对象:
windowId
可选-
integer
,要打开弹窗的那一窗口,默认为当前窗口。
返回值
没有兑现任何参数的 Promise
。
示例
当用户选择上下文菜单项时打开弹窗:
js
browser.menus.create({
id: "open-popup",
title: "open popup",
contexts: ["all"],
});
browser.menus.onClicked.addListener(() => {
browser.action.openPopup();
});
浏览器兼容性
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
- See implementation notes.
- Has more compatibility info.
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.