Skip to content
Permalink
Browse files

Fixed crash during plugins installation on Linux (#7)

* Fix problem in installer.js that crashes Opera on Linux.
* Update version to 2.4.1
  • Loading branch information...
suevalov authored and aswitalski committed Nov 28, 2017
1 parent a3fe510 commit a67bcb3f5afb3e6b382149443b540228e2865e02
Showing with 21 additions and 26 deletions.
  1. +20 −25 api/installer.js
  2. +1 −1 manifest.json
@@ -153,31 +153,26 @@ class Installer extends Api {
this.onDownloadProgress.dispatch({id, percentDownloaded: 0});
this.onInstallStageChanged.dispatch(
{id, stage: this.InstallStage.DOWNLOADING});
chrome.downloads.download(options);
return new Promise((onUnpacked, onError) => {
let interv = setInterval(() => {
Promise
.all([
this.getExtension_(id),
this.getDownload_(options.url),
])
.then(details => {
const [extension, download] = details;
if (extension) {
clearInterval(interv);
this.onDownloadProgress.dispatch({id, percentDownloaded: 1});
onUnpacked();
} else if (download && download.error) {
clearInterval(interv);
alert(chrome.i18n.getMessage('installerErrorNetwork'));
onError();
} else if (Date.now() > maxTime) {
clearInterval(interv);
alert(chrome.i18n.getMessage('installerErrorTimeout'));
onError();
}
});
}, 1000);
return new Promise((resolve, reject) => {

chrome.downloads.download(options, (downloadId) => {
if (downloadId) {
this.onDownloadProgress.dispatch({id, percentDownloaded: 1});
resolve();
} else {
this.getDownload_(options.url).then((download) => {
if (download && download.error) {
alert(chrome.i18n.getMessage('installerErrorNetwork'));
} else if (Date.now() > maxTime) {
alert(chrome.i18n.getMessage('installerErrorTimeout'));
}
reject();
}).catch(() => {
reject();
});
}
});

});
}

@@ -35,7 +35,7 @@
"/background/app.js"
]
},
"version": "2.4.0",
"version": "2.4.1",
"manifest_version": 2,
"page_action": {
"default_icon": "icons/19.png",

1 comment on commit a67bcb3

@serial02

This comment has been minimized.

Copy link

commented on a67bcb3 Nov 28, 2017

Hello Team Download Chrome Extension

With this new version 2.4.1 the extension was re-run, with only a small confirmation message showing.

I put the option to collect errors for future scans.

I thank you for your attention

Serial02

Please sign in to comment.
You can’t perform that action at this time.