Skip to content

Commit

Permalink
Fix downloading updates from the right URL.
Browse files Browse the repository at this point in the history
Refs greasemonkey#1497 - Introduced bug
Fixes greasemonkey#1669
  • Loading branch information
arantius committed Nov 16, 2012
1 parent d3d34f6 commit ee08a5a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions modules/addons4.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
var EXPORTED_SYMBOLS = [
'GM_addonsStartup', 'SCRIPT_ADDON_TYPE',
'ScriptAddonFactoryByScript', 'ScriptAddonReplaceScript',
'ScriptInstallFactoryByAddon',
];

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -207,7 +206,7 @@ ScriptAddon.prototype._handleRemoteUpdate = function(
}
// Then create one with this newly found update info.
var scriptInstall = ScriptInstallFactoryByAddon(
this, this._script.availableUpdate);
this, this._script);
AddonManagerPrivate.callInstallListeners(
'onNewInstall', [], scriptInstall);
tryToCall(aUpdateListener, 'onUpdateAvailable', this, scriptInstall);
Expand Down Expand Up @@ -249,19 +248,20 @@ ScriptAddon.prototype.performUninstall = function() {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

var ScriptInstallCache = {};
function ScriptInstallFactoryByAddon(aAddon, aScriptToInstall) {
function ScriptInstallFactoryByAddon(aAddon) {
if (!(aAddon.id in ScriptInstallCache)) {
ScriptInstallCache[aAddon.id] = new ScriptInstall(aAddon, aScriptToInstall);
ScriptInstallCache[aAddon.id] = new ScriptInstall(aAddon);
}
return ScriptInstallCache[aAddon.id];
}

function ScriptInstall(aAddon, aScriptToInstall) {
this._script = aScriptToInstall || aAddon._script;
function ScriptInstall(aAddon) {
var newScript = aAddon._script.availableUpdate;
this.iconURL = newScript.icon.fileURL;
this.name = newScript.name;
this.version = newScript.version;

this.name = this._script.name;
this.version = this._script.version;
this.iconURL = this._script.icon.fileURL;
this._script = aAddon._script;
this.existingAddon = aAddon;

this._listeners = [];
Expand Down

0 comments on commit ee08a5a

Please sign in to comment.