commit 21fadee7bb2dd5db7eafc55108f886a6a28af2b2
parent d4fce3c855ece69c8c7103ea4aeccd309ae17039
Author: Adomas VenĨkauskas <adomas.ven@gmail.com>
Date: Tue, 3 Apr 2018 13:32:23 +0300
Refactor word plugin installer
Diffstat:
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/resource/word-processor-plugin-installer.js b/resource/word-processor-plugin-installer.js
@@ -68,7 +68,7 @@ var ZoteroPluginInstaller = function(addon, failSilently, force) {
Zotero.debug("PluginInstaller: fetching addon info");
AddonManager.getAddonsByIDs(extensionIDs, function(addons) {
Zotero.debug("PluginInstaller: addon info fetched");
- me._addons = addons;
+ me._addonInfo = addons[0];
me._addonInfoAvailable();
});
};
@@ -78,7 +78,7 @@ ZoteroPluginInstaller.prototype = {
_addonInfoAvailable: function() {
try {
- this._version = this._addons[0].version;
+ this._version = this._addonInfo.version;
try {
this._addon.verifyNotCorrupt(this);
@@ -127,19 +127,8 @@ ZoteroPluginInstaller.prototype = {
},
getAddonPath: function(addonID) {
- if(AddonManager) {
- for (var addon of this._addons) {
- if(addon && addon.id == addonID) {
- return addon.getResourceURI().
- QueryInterface(Components.interfaces.nsIFileURL).file;
- }
- }
- } else {
- return Components.classes["@mozilla.org/extensions/manager;1"].
- getService(Components.interfaces.nsIExtensionManager).
- getInstallLocation(addonID).
- getItemLocation(addonID);
- }
+ return this._addonInfo.getResourceURI().
+ QueryInterface(Components.interfaces.nsIFileURL).file;
},
setProgressWindowLabel: function(value) {