management.uninstall()

Uninstalls an add-on, given its ID.

This API requires the "management" API permission.

This is an asynchronous function that returns a Promise.

Syntax

js
let uninstalling = browser.management.uninstall(
  id,                  // string
  options              // object
)

Parameters

id

string. ID of the add-on to uninstall.

options Optional

object. Object which may contain a single property, showConfirmDialog. If showConfirmDialog is true, the browser will show a dialog asking the user to confirm that the add-on should be uninstalled.

  • If id is the calling add-on's ID, showConfirmDialog defaults to false.
  • If id is the ID of a different add-on, the showConfirmDialog option is ignored and the confirmation dialog is always shown.

Return value

A Promise that will be rejected with an error message if the user canceled the uninstallation.

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
uninstall

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Examples

Uninstall the add-on whose ID is "addon-id" and ask the user to confirm. In the callback, we check whether the user canceled the uninstallation or if the operation succeeded.

js
let id = "addon-id";

function onCanceled(error) {
  console.log(`Canceled: ${error}`);
}

function onUninstalled() {
  console.log("Uninstalled");
}

let uninstalling = browser.management.uninstall(id);
uninstalling.then(onUninstalled, onCanceled);

Note: This API is based on Chromium's chrome.management API. This documentation is derived from management.json in the Chromium code.