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.

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);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
setUninstallURL
Chrome – No support
Chrome 41 – 114 (Release date: 2015-03-03)
footnote The maximum length is 255 characters.
Chrome – Full support
Chrome 115 (Release date: 2023-07-18)
footnote
footnote The maximum length is 1023 characters.
Edge – No support
Edge 79 – 114 (Release date: 2020-01-15)
footnote The maximum length is 255 characters.
Edge – Full support
Edge 115 (Release date: 2023-07-21)
footnote
footnote The maximum length is 1023 characters.
Firefox – No support
Firefox 47 – 115 (Release date: 2016-06-07)
footnote The maximum length is 255 characters.
Firefox – Full support
Firefox 116 (Release date: 2023-08-01)
footnote
footnote The maximum length is 1023 characters.
Opera – No support
Opera 28 – 100 (Release date: 2015-03-10)
footnote The maximum length is 255 characters.
Opera – Full support
Opera 101 (Release date: 2023-07-26)
footnote
footnote The maximum length is 1023 characters.
Safari – Partial support
Safari 14 (Release date: 2020-09-16)
footnote Partial support
footnote API exists, but has no effect.
Firefox for Android – No support
Firefox for Android 48 – 115 (Release date: 2016-08-02)
footnote The maximum length is 255 characters.
Firefox for Android – Full support
Firefox for Android 116 (Release date: 2023-08-01)
footnote
footnote The maximum length is 1023 characters.
Safari on iOS – Partial support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Partial support
footnote API exists, but has no effect.

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.

Note: This API is based on Chromium's chrome.runtime API. This documentation is derived from runtime.json in the Chromium code.