theme.reset()
Resets any theme that was applied using the theme.update()
method.
Note that this will always reset the theme back to the original default theme, even if the user had selected a different theme before this extension's theme was applied (see bug 1415267).
Syntax
browser.theme.reset(
windowId // integer
)
Parameters
Browser compatibility
Report problems with this compatibility data on GitHubwebextensions-desktop | webextensions-mobile | |||||
---|---|---|---|---|---|---|
reset | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support56 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
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.
Examples
This code applies a theme, then removes it when the user clicks a browser action:
browser.theme.update(themes.night);
browser.browserAction.onClicked.addListener(() => {
browser.theme.reset();
});