Search code examples
google-chrome-extensioninstallationwebstore

How to trigger onDownloadProgress while installing Chrome Extension?


I would like to know how to trigger the onDownloadProgress event. I made an extension, uploaded it to the Chrome Store and followed every step detailed here: http://developer.chrome.com/webstore/inline_installation

Now I'm trying to display a progress bar to users when they install my extension but I get the following error:

Uncaught TypeError: Cannot call method 'addListener' of undefined

this is the code I'm using:

chrome.webstore.onDownloadProgress.addListener(function(percentage){
console.log(percentage)
});

chrome.webstore.install('MY_EXTENSION_ID', function(){ console.log('installed') }, function(error){ console.log(error) });

It is part of their docs here: http://developer.chrome.com/extensions/webstore and it's not working at all.


Solution

  • It looks like these events were added to Chrome's trunk code only 5 days ago. They are available now on Chrome Canary, but it will be a while until they are present in the regular Chrome channel.

    I don't know why the documentation page is already listing them.