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

windowId Optional
integer. The ID of a window. If this is provided, the theme applied to that window will be reset. If it is omitted the theme will be reset on all windows.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
Basic supportChrome No support NoEdge No support NoFirefox Full support 56Opera No support NoFirefox Android No support No
windowIdChrome No support NoEdge No support NoFirefox Full support 57Opera No support NoFirefox Android No support No

Legend

Full support  
Full support
No support  
No support

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();
});

Example extensions

 

Document Tags and Contributors

Contributors to this page: PikadudeNo1, wbamberg, ntim
Last updated by: PikadudeNo1,