Movatterモバイル変換


[0]ホーム

URL:


  1. Mozilla
  2. Add-ons
  3. Browser extensions
  4. JavaScript APIs
  5. theme
  6. theme.reset()

theme.reset()

Resets any theme applied using thetheme.update() method.

To use this method, an extension must request the "theme"permission in itsmanifest.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 (seebug 1415267).

Syntax

js
browser.theme.reset(  windowId     // integer)

Parameters

windowIdOptional

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

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp