From bc7b2cb3d57efccc30712902f46ad58334adb37b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 1 Jan 2020 22:17:31 -0500 Subject: [PATCH] Fix extension installation failure message And fix logged error when starting an extension installation https://groups.google.com/d/topic/zotero-dev/rP42v7OF9N0/discussion --- chrome/content/zotero/standalone/standalone.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js index 2ef4ed9e32..8e64002015 100644 --- a/chrome/content/zotero/standalone/standalone.js +++ b/chrome/content/zotero/standalone/standalone.js @@ -757,17 +757,16 @@ function openWindowByType(uri, type, features) { } const gXPInstallObserver = { - observe: function (aSubject, aTopic, aData) { - var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo); - var win = installInfo.originatingWindow; - switch (aTopic) { + observe: function (subject, topic, data) { + const { installs } = subject.wrappedJSObject; + switch (topic) { case "addon-install-disabled": case "addon-install-blocked": case "addon-install-failed": - var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] - .getService(Components.interfaces.nsIPromptService); - promptService.alert(win, Zotero.getString("standalone.addonInstallationFailed.title"), - Zotero.getString("standalone.addonInstallationFailed.body", installInfo.installs[0].name)); + Zotero.alert( + null, + Zotero.getString("standalone.addonInstallationFailed.title"), + Zotero.getString("standalone.addonInstallationFailed.body", installs[0].name)); break; /*case "addon-install-started": case "addon-install-complete":*/