Refactor word plugin installer

This commit is contained in:
Adomas Venčkauskas 2018-04-03 13:32:23 +03:00
parent d4fce3c855
commit 21fadee7bb

View file

@ -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) {