Movatterモバイル変換


[0]ホーム

URL:


  1. Mozilla
  2. Add-ons
  3. Browser extensions
  4. JavaScript APIs
  5. management
  6. management.uninstall()

management.uninstall()

Uninstalls an add-on, given its ID.

This API requires the "management"API permission.

This is an asynchronous function that returns aPromise.

Syntax

js
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. IfshowConfirmDialog istrue, the browser will show a dialog asking the user to confirm that the add-on should be uninstalled.

  • Ifid is the calling add-on's ID,showConfirmDialog defaults tofalse.
  • Ifid is the ID of a different add-on, theshowConfirmDialog option 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.

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

Note:This API is based on Chromium'schrome.management API. This documentation is derived frommanagement.json in the Chromium code.

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp