runtime.requestUpdateCheck()

Checks to see if an update for the extension is available.

This is an asynchronous function that returns a Promise.

Syntax

js
let requestingCheck = browser.runtime.requestUpdateCheck()

Parameters

None.

Return value

A Promise that is fulfilled with an object with the result of the update request.

result

An object with the following properties:

status

runtime.RequestUpdateCheckStatus. The result of the update check.

version Optional

string. The update's version, if status is update_available.

Examples

Request an update and log the new version if one is available:

js
function onRequested(result) {
  console.log(result.status);
  if (result.status === "update_available") {
    console.log(result.version);
  }
}

function onError(error) {
  console.log(`Error: ${error}`);
}

let requestingCheck = browser.runtime.requestUpdateCheck();
requestingCheck.then(onRequested, onError);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
requestUpdateCheck
Chrome – Full support
Chrome 25 (Release date: 2013-02-21)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

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

Full support
Full support
No support
No support

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