Ankit Panwar
Ankit Panwar

Reputation: 11

how chrome.runtime.onUpdateAvailable.addListener will work for extension?

I am creating an extension and I want to autoupdate my .crx file if any update is available, so can anyone tell me how this listener works with the extension and when it will be fired.

chrome.runtime.onUpdateAvailable.addListener(function (details) {    
  console.log("updating to version " + details.version);
  chrome.runtime.reload();
});

Upvotes: 0

Views: 1180

Answers (1)

BeardFist
BeardFist

Reputation: 8201

The chrome.runtime.onUpdateAvailable event is fired

when an update is available, but isn't installed immediately because the app is currently running.

Meaning it has no part in actually getting the update. To handle updating your app, you can either publish it through the Crhome App store or use the update_url field in the manifest to let it know when there is an update.

Upvotes: 1

Related Questions