Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebExt: fix typo #37091

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,33 @@ let uninstalling = browser.management.uninstall(
<!---->

- If `id` is the calling add-on's ID, `showConfirmDialog` defaults to `false`.
- If `id` is a the ID of a different add-on, the `showConfirmDialog` option is ignored and the confirmation dialog is always shown.
- If `id` is an ID of a different add-on, the `showConfirmDialog` option is ignored and the confirmation dialog is always shown.
PassionPenguin marked this conversation as resolved.
Show resolved Hide resolved

### Return value

A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be rejected with an error message if the user canceled uninstall.
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be rejected with an error message if the user canceled the uninstallation.

## Browser compatibility

{{Compat}}

## Examples

Uninstall the add-on whose ID is "my-addon-id", asking the user to confirm. In the callback, check whether the user canceled uninstallation.

Note that we haven't passed a fulfillment handler because if uninstallation succeeds, the add-on is no longer around to handle it.
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.
PassionPenguin marked this conversation as resolved.
Show resolved Hide resolved

```js
let id = "my-addon-id";
let id = "addon-id";

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

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

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

{{WebExtExamples}}
Expand Down
Loading