Browser APIs pertaining to the browser and system themes.
Kind: global class
object
object
function
boolean
Check whether the browser supports theme customizations.
Kind: instance method of ThemeAPI
Returns: boolean
- True if theme customizations are supported.
BackgroundImage
Create an object holding the default background image properties.
Kind: instance method of ThemeAPI
Returns: BackgroundImage
- The default background image.
Add an observer to be notified when the browser or system theme has changed. The provided callback is triggered immediately with the current theme.
Kind: instance method of ThemeAPI
Param | Type | Description |
---|---|---|
observer | ThemeChanged |
Callback triggered when the browser or system theme has changed. |
Show or hide the Customize Chrome side panel.
Kind: instance method of ThemeAPI
object
Meta-information about a background image.
Kind: static typedef of ThemeAPI
See: https://github.com/chromium/chromium/blob/80.0.3987.0/chrome/browser/search/background/ntp_background_data.h#L55
Properties
Name | Type | Description |
---|---|---|
imageUrl | string |
URL of the image. |
imageAlignment | string |
The CSS background-position image style. |
imageTiling | string |
The CSS background-repeat image style. |
thumbnailUrl | string |
URL of a thumbnail for the image. |
attributionLine1 | string |
First line of any attribution for the image, possibly empty. |
attributionLine2 | string |
Second line of any attribution for the image, possibly empty. |
attributionUrl | string |
A URL to find out more about the image, possibly empty. |
attributionImageUrl | string |
URL of the attribution image, possibly empty. |
object
Object defining the system’ and user’s theme.
Kind: static typedef of ThemeAPI
Properties
Name | Type | Description |
---|---|---|
darkModeEnabled | boolean |
The system’s dark mode preference. |
background | BackgroundImage |
The background image chosen by the user, if any. |
function
Callback triggered when browser or system theme has changed.
Kind: static typedef of ThemeAPI
Param | Type | Description |
---|---|---|
theme | Theme |
The newly applied theme. |