tabs.onHighlightChanged
警告:
此事件已被弃用。请使用 tabs.onHighlighted
代替。
当窗口中高亮或选中的标签页更改时触发。
语法
js
browser.tabs.onHighlightChanged.addListener(listener)
browser.tabs.onHighlightChanged.removeListener(listener)
browser.tabs.onHighlightChanged.hasListener(listener)
事件具有三个函数:
addListener(listener)
-
向此事件添加一个监听器。
removeListener(listener)
-
停止监听此事件。
listener
参数是要移除的监听器。 hasListener(listener)
-
检查
listener
是否已注册此事件。如果正在监听,则返回true
,否则返回false
。
addListener 语法
参数
listener
-
此事件发生时调用的函数。该函数接收以下参数:
selectInfo
-
object
。详见 selectInfo 部分。
附加对象
selectInfo
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
onHighlightChanged |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
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.tabs
API。此文档来自 Chromium 代码中的 tabs.json
。