runtime.setUninstallURL()

Sets the URL to be visited when the extension is uninstalled. This can be used to clean up server-side data, do analytics, or implement surveys. The URL can be up to 1023 characters. This limit used to be 255, see Browser compatibility for more details.

This is an asynchronous function that returns a Promise.

Syntax

js
let settingUrl = browser.runtime.setUninstallURL(
  url             // string
)

Parameters

url

string. URL to open after the extension is uninstalled. This URL must have an http or https scheme. Can be up to 1023 characters. Set to an empty string to not open a new tab when the extension is uninstalled.

Return value

A Promise fulfilled with no arguments when the URL is set or rejected with an error message if the operation fails.

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
setUninstallURL

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
See implementation notes.
Has more compatibility info.

Examples

js
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.