management.uninstall()
Uninstalls an add-on, given its ID.
This API requires the "management"API permission.
This is an asynchronous function that returns aPromise.
In this article
Syntax
let uninstalling = browser.management.uninstall( id, // string options // object)Parameters
idstring. ID of the add-on to uninstall.optionsOptionalobject. Object which may contain a single property,showConfirmDialog. IfshowConfirmDialogistrue, the browser will show a dialog asking the user to confirm that the add-on should be uninstalled.
- If
idis the calling add-on's ID,showConfirmDialogdefaults tofalse. - If
idis the ID of a different add-on, theshowConfirmDialogoption is ignored and the confirmation dialog is always shown.
Return value
APromise 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.
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
Note:This API is based on Chromium'schrome.management API. This documentation is derived frommanagement.json in the Chromium code.