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, ifstatus
isupdate_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
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
requestUpdateCheck |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Note:
This API is based on Chromium's chrome.runtime
API. This documentation is derived from runtime.json
in the Chromium code.