Gets the currently used theme as a Theme
object.
This is an asynchronous function that returns a Promise
.
Syntax
var getting = browser.theme.getCurrent( windowId // integer )
Parameters
windowId
Optionalinteger
. The ID of a window. If this is provided, the theme applied on that window will be provided. If it is omitted the theme applied on the last focused window will be provided.
Return value
A Promise
. The promise will be fulfilled with a theme.Theme
object representing the theme applied to the given window. If no extension-supplied theme has been applied to the given window, it will be fulfilled with an empty object.
Browser compatibility
The compatibility table in 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.
Chrome | Edge | Firefox | Firefox for Android | Opera | |
---|---|---|---|---|---|
Basic support | No | No | 58 | No | No |
Examples
async function getCurrentThemeInfo() { let themeInfo = await browser.theme.getCurrent(); console.log(themeInfo); } getCurrentThemeInfo();