addons: an add-on naming both the AppCompat GUID and the toolkit is matched by the entry that fits

matchingTargetApplication prefers, in order: this application's own id, the
AppCompat GUID (extensions.guid.appCompatId, the Firefox GUID), the toolkit.
The AppCompat entry was taken whenever present, whatever its version range.

An add-on can name both for different reasons: the GUID entry for the
application that owns that GUID, at that application's versions (Basilisk is
{ec8030f7-...} at 52.9.x), and a toolkit entry meaning "any other application
on this platform". For an application that is neither, with an AppCompat
version of 56.9, the GUID entry "52.9.0 - 52.9.*" under strict compatibility
does not fit - and because it was preferred, the toolkit entry that does
describe the application was never looked at. The add-on was installed and
immediately disabled as incompatible.

Now the AppCompat entry is used only if it admits the AppCompat version (both
bounds under strict compatibility, the lower bound otherwise - the rule
isCompatibleWith applies) or if there is no toolkit entry to fall back to.
Nothing changes for an add-on that names one of the two, or whose GUID entry
fits.

Found with Palefill 1.30 (toolkit@mozilla.org 4.8.2 - 10.*, platform 6.9.0),
which now installs enabled and applies its fixes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LcrVQFRMC2ANGDfVaRG9Ed
This commit is contained in:
NotAlexNoyleandClaude Fable 5.1 committed 2026-10-05 18:11:17 -04:00
1 parent 628ee50c99
commit db070f0003
1 file changed
+27 -1
@@ -6432,8 +6432,19 @@ AddonInternal.prototype = {
// Only do this for extensions. Other types should not be allowed.
if (this.type == "extension") {
for (let targetApp of this.targetApplications) {
if (targetApp.id == APPCOMPATID) // AppCompat GUID
if (targetApp.id == APPCOMPATID) { // AppCompat GUID
// An add-on may name BOTH the AppCompat GUID and the toolkit: the GUID entry
// written for the application that owns that GUID, at that application's
// versions, and the toolkit entry for "any other application on this platform".
// Taking the GUID entry regardless disabled exactly the add-ons that had gone
// to the trouble of declaring generic platform support (one whose GUID entry
// says 52.9.*, against an AppCompat version of 56.9). Where the GUID entry does
// not fit this application's AppCompat version and a toolkit entry was given,
// the toolkit entry is the one that describes us.
if (app && !this._fitsAppCompat(targetApp))
break;
return targetApp;
}
}
}
#endif
@@ -6441,6 +6452,21 @@ AddonInternal.prototype = {
return app;
},
#ifdef UXP_APPCOMPAT_GUID
// Whether aTargetApp (an AppCompat GUID entry) admits this application's AppCompat
// version, by the same rule isCompatibleWith applies: both bounds under strict
// compatibility, the lower bound alone otherwise.
_fitsAppCompat: function AddonInternal_fitsAppCompat(aTargetApp) {
let strict = !(this.type in COMPATIBLE_BY_DEFAULT_TYPES) ||
AddonManager.strictCompatibility || this.strictCompatibility ||
this.hasBinaryComponents;
if (Services.vc.compare(APPCOMPATVERSION, aTargetApp.minVersion) < 0)
return false;
return !strict || Services.vc.compare(APPCOMPATVERSION, aTargetApp.maxVersion) <= 0;
},
#endif
get blocklistState() {
let staticItem = findMatchingStaticBlocklistItem(this);
if (staticItem)