theme
使浏览器扩展能够获取浏览器主题的详细信息并更新主题。
你可以使用此 API 在扩展中包含一个主题,该主题定义为 theme.Theme
并通过 theme.update()
应用。你不能在扩展中包含静态主题,静态主题是用“theme”清单键定义的。清单键“theme”仅用于定义静态主题。有关更多信息,请参见 Extension Workshop 上的 Themes。
类型
theme.Theme
-
代表一个主题的内容。
函数
theme.getCurrent()
-
获取当前浏览器主题。
theme.update()
-
更新浏览器的主题。
theme.reset()
-
移除通过调用
theme.update()
所做的任何主题更新。
事件
theme.onUpdated
-
当浏览器主题改变时触发。
示例扩展
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
theme | |||||||
Theme | |||||||
getCurrent | |||||||
onUpdated | |||||||
reset | |||||||
reset.windowId | |||||||
update | |||||||
update.windowId |
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.