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.

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);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
uninstall
Chrome – Full support
Chrome 8 (Release date: 2010-12-02)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

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

Full support
Full support
No support
No support

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