【发布时间】:2014-03-31 18:59:54
【问题描述】:
我想知道如何触发onDownloadProgress 事件。我做了一个扩展,将其上传到 Chrome 商店,并按照此处详述的每一步操作:http://developer.chrome.com/webstore/inline_installation
现在我尝试在用户安装我的扩展程序时向他们显示进度条,但我收到以下错误:
Uncaught TypeError: Cannot call method 'addListener' of undefined
这是我正在使用的代码:
chrome.webstore.onDownloadProgress.addListener(function(percentage){
console.log(percentage)
});
chrome.webstore.install('MY_EXTENSION_ID', function(){ console.log('installed') }, function(error){ console.log(error) });
这是他们文档的一部分:http://developer.chrome.com/extensions/webstore 它根本不起作用。
【问题讨论】:
标签: google-chrome-extension installation webstore