theme
Enables browser extensions to update the browser theme.
To use this API, an extension must request the "theme" permission in its manifest.json file.
Note: When we set up a theme in a background file, we must declare the 'theme' permission and therefore we cannot use the theme function of the manifest, since it's not compatible.
Types
theme.Theme
- Represents the content of a theme.
Functions
theme.getCurrent()
- Gets the current browser theme.
theme.update()
- Updates the browser’s theme.
theme.reset()
- Removes any theme updates made in a call to
theme.update()
.
Events
theme.onUpdated
- Fired when the browser theme has been changed.
Browser compatibility
Report problems with this compatibility data on GitHubwebextensions-desktop | webextensions-mobile | |||||
---|---|---|---|---|---|---|
Theme | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support55 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
getCurrent | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support58 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
onUpdated | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support58 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
reset | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support56 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
reset.windowId | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support57 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
update | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support55 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
update.windowId | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support57 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
Legend
- 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.