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
let uninstalling = browser.management.uninstall(
id, // string
options // object
)
Parameters
id-
string. ID of the add-on to uninstall. optionsOptional-
object. 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
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.
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
Loading…
Note:
This API is based on Chromium's chrome.management API. This documentation is derived from management.json in the Chromium code.