Installs and enables a theme extension from the given URL.

This API requires the "management" API permission and will only work with signed themes.

This is an asynchronous function that returns a Promise.


let {id} = await{url});


An object that includes the URL of the XPI file of the theme at and an optional a hash of the XPI file, using sha256 or stronger.

Return value

A Promise that will be fulfilled with an object, containing the ExtensionID defined for the theme in manifest.json.

Browser compatibility

No compatibility data found. Please contribute data for "" (depth: 1) to the MDN compatibility data repository.


Cycle through a list of themes:

"use strict";

let themes = [

let current;

async function install(url) {
    try {
        current = url;
        let {id} = await{url});
        console.log("Theme installed: " + id);
    } catch (e) {
        console.error("Installation failed: " + e);

browser.browserAction.onClicked.addListener(() => {
    let id = themes.indexOf(current);
    install(themes[(id + 1) % themes.length]);

for (let url of themes) {
        title: url,
        onclick: () => install(url),
        contexts: ["browser_action"],

Document Tags and Contributors

Contributors to this page: mdnwebdocs-bot, wbamberg, Llamaless, hellosct1, irenesmith
Last updated by: mdnwebdocs-bot,