theme.reset()
Resets any theme applied using the theme.update()
method.
To use this method, an extension must request the "theme" permission in its manifest.json file.
Note that this always reset the theme back to the original default theme, even if the user selected a different theme before this extension's theme was applied (see bug 1415267).
Syntax
js
browser.theme.reset(
windowId // integer
)
Parameters
windowId
Optional-
integer
. The ID of a window. If this is provided, the theme applied to that window is reset. If it is omitted, the theme is reset on all windows.
Examples
This code applies a theme, then removes it when the user clicks a browser action:
js
browser.theme.update(themes.night);
browser.browserAction.onClicked.addListener(() => {
browser.theme.reset();
});
Example extensions
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
reset | |||||||
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.