Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
🐛 Addons should now update correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
trickypr committed Dec 24, 2023
1 parent c563b05 commit b4903fb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Changed

- Update to firefox `121.0`
- Bump to preprelease betterfox
- Bump to prerelease betterfox

## Fixed

- Addons will now update correctly (will send platform version rather than app version)

## 1.0.0-a.84

Expand Down
28 changes: 28 additions & 0 deletions src/toolkit/mozapps/extensions/internal/XPIInstall-jsm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/toolkit/mozapps/extensions/internal/XPIInstall.jsm b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
index e0cac973f657048b34ee46e090dd0f3a85f1d91e..cbfa7b8130cee804850c13ad260f46dae18ef856 100644
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -2922,11 +2922,13 @@ var UpdateChecker = function (
"resource://gre/modules/addons/AddonUpdateChecker.sys.mjs"
));

+ if (!aPlatformVersion) aPlatformVersion = Services.appinfo.platformVersion;
+
this.addon = aAddon;
aAddon._updateCheck = this;
XPIInstall.doing(this);
this.listener = aListener;
- this.appVersion = aAppVersion;
+ this.appVersion = aPlatformVersion;
this.platformVersion = aPlatformVersion;
this.syncCompatibility =
aReason == AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED;
@@ -2953,7 +2955,7 @@ var UpdateChecker = function (
aReason |= UPDATE_TYPE_NEWVERSION;
}

- let url = escapeAddonURI(aAddon, updateURL, aReason, aAppVersion);
+ let url = escapeAddonURI(aAddon, updateURL, aReason, aPlatformVersion);
this._parser = AddonUpdateChecker.checkForUpdates(aAddon.id, url, this);
};

0 comments on commit b4903fb

Please sign in to comment.