The theme API allows customizing of visual elements of the browser.

Not allowed in: Content scripts, Devtools pages

ThemeUpdateInfo
onUpdated
getCurrent
reset
update
onUpdated: WebExtEvent<(updateInfo: ThemeUpdateInfo) => void>

Fired when a new theme has been applied

Details of the theme update

  • Returns the current theme for the specified window or the last focused window.

    Parameters

    • OptionalwindowId: number

      The window for which we want the theme.

    Returns Promise<ThemeType>

  • Removes the updates made to the theme.

    Parameters

    • OptionalwindowId: number

      The id of the window to reset. No id resets all windows.

    Returns void

  • Make complete updates to the theme. Resolves when the update has completed.

    Parameters

    • details: ThemeType

      The properties of the theme to update.

    Returns void

  • Make complete updates to the theme. Resolves when the update has completed.

    Parameters

    • windowId: number

      The id of the window to update. No id updates all windows.

    • details: ThemeType

      The properties of the theme to update.

    Returns void