Sets the URL to be visited when the extension is uninstalled. This may be used to clean up server-side data, do analytics, or implement surveys. The URL can be a maximum 255 characters.
This is an asynchronous function that returns a Promise
.
Sets the URL to be visited when the extension is uninstalled. This may be used to clean up server-side data, do analytics, or implement surveys. The URL can be a maximum 255 characters.
This is an asynchronous function that returns a Promise
.
let settingUrl = browser.runtime.setUninstallURL(
url // string
)
url
string
. URL to be opened after the extension is uninstalled. This URL must have an http
or https
scheme. Set it to an empty string to not open a new tab upon uninstallation.
A Promise
that will be fulfilled with no arguments when the URL has been set, or rejected with an error message if the operation failed.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
setUninstallURL |
41 | 15 | 47 | ? | 28 |
14API exists, but has no effect. |
? | ? | 48 | ? |
15API exists, but has no effect. |
? |
function onSetURL() {
console.log("set uninstall URL");
}
function onError(error) {
console.log(`Error: ${error}`);
}
let settingUrl = browser.runtime.setUninstallURL("https://example.org");
settingUrl.then(onSetURL, onError);
Note: This API is based on Chromium's chrome.runtime
API. This documentation is derived from runtime.json
in the Chromium code.
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/setUninstallURL