Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

runtime.setUninstallURL()

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

Sets the URL to be visited when the add-on 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.

Syntax

chrome.runtime.setUninstallURL(
  url,             // string
  function() {...} // optional function
)

This API is also available as browser.runtime.setUninstallURL() in a version that returns a promise.

Parameters

url
string. URL to be opened after the add-on 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.
callbackOptional
function. Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set.

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes No 47.0 48.0 33

Examples

function onSetURL() {
  if (chrome.runtime.lastError) {
    console.log(chrome.runtime.lastError);
    // handle the error
  } else {
    console.log("set uninstall URL");
  }
}

chrome.browserAction.onClicked.addListener((tab) => {
  chrome.runtime.setUninstallURL("https://example.org", onSetURL);
});

Acknowledgements

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

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

ドキュメントのタグと貢献者

 このページの貢献者: Makyen, chrisdavidmills, wbamberg
 最終更新者: Makyen,