pageAction.show()
在指定的标签页中显示页面操作。只要指定的标签页是活动标签页就会显示页面操作。
show()
会覆盖模式匹配,所以即使 show_matches
不匹配 URL 或者 hide_matches
匹配 URL,页面操作也会在指定的标签页中显示。
请注意,对没有加载内容的标签页调用 show()
将不起作用。
语法
js
browser.pageAction.show(
tabId // 整型
)
参数
返回值
Promise,将以 undefined
兑现。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
show |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
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.
示例
示例扩展
备注:
该 API 基于 Chromium 的 chrome.pageAction
API。本文衍生自 Chromium 代码中的 page_action.json
。