mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Spoof to Firefox 128 for WebExtensions
This commit is contained in:
parent
f2703f7f95
commit
223d5d6a25
3 changed files with 25 additions and 6 deletions
|
|
@ -94,7 +94,9 @@ extensions.registerSchemaAPI("runtime", "addon_parent", context => {
|
||||||
|
|
||||||
getBrowserInfo: function() {
|
getBrowserInfo: function() {
|
||||||
const {name, vendor, version, appBuildID} = Services.appinfo;
|
const {name, vendor, version, appBuildID} = Services.appinfo;
|
||||||
const info = {name, vendor, version, buildID: appBuildID};
|
// Override version for WebExtensions compatibility with modern extensions
|
||||||
|
// Report as Firefox 128.0 to extensions while maintaining actual UXP identity
|
||||||
|
const info = {name: "Firefox", vendor, version: "128.0", buildID: appBuildID};
|
||||||
return Promise.resolve(info);
|
return Promise.resolve(info);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6380,6 +6380,10 @@ AddonInternal.prototype = {
|
||||||
let version;
|
let version;
|
||||||
if (app.id == Services.appinfo.ID) {
|
if (app.id == Services.appinfo.ID) {
|
||||||
version = aAppVersion;
|
version = aAppVersion;
|
||||||
|
// For WebExtensions, report as Firefox 128.0 for compatibility
|
||||||
|
if (this.type == "extension") {
|
||||||
|
version = "128.0";
|
||||||
|
}
|
||||||
#ifdef MOZ_PHOENIX_EXTENSIONS
|
#ifdef MOZ_PHOENIX_EXTENSIONS
|
||||||
this.native = true;
|
this.native = true;
|
||||||
}
|
}
|
||||||
|
|
@ -6391,10 +6395,15 @@ AddonInternal.prototype = {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (app.id == TOOLKIT_ID) {
|
else if (app.id == TOOLKIT_ID) {
|
||||||
|
// For WebExtensions against toolkit, report as Firefox 128.0
|
||||||
|
if (this.type == "extension") {
|
||||||
|
version = "128.0";
|
||||||
|
} else {
|
||||||
|
version = aPlatformVersion;
|
||||||
|
}
|
||||||
#ifdef MOZ_PHOENIX_EXTENSIONS
|
#ifdef MOZ_PHOENIX_EXTENSIONS
|
||||||
this.native = true;
|
this.native = true;
|
||||||
#endif
|
#endif
|
||||||
version = aPlatformVersion;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only extensions and dictionaries can be compatible by default; themes
|
// Only extensions and dictionaries can be compatible by default; themes
|
||||||
|
|
|
||||||
|
|
@ -7001,12 +7001,20 @@ AddonInternal.prototype = {
|
||||||
aPlatformVersion = Services.appinfo.platformVersion;
|
aPlatformVersion = Services.appinfo.platformVersion;
|
||||||
|
|
||||||
let version;
|
let version;
|
||||||
if (app.id == Services.appinfo.ID)
|
if (app.id == Services.appinfo.ID) {
|
||||||
version = aAppVersion;
|
// For WebExtensions, report as Firefox 128.0 for compatibility
|
||||||
|
if (this.type == "extension") {
|
||||||
|
version = "128.0";
|
||||||
|
} else {
|
||||||
|
version = aAppVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (app.id == TOOLKIT_ID)
|
else if (app.id == TOOLKIT_ID)
|
||||||
version = aPlatformVersion
|
version = aPlatformVersion
|
||||||
else if (app.id == WEBEXTENSIONS_ID)
|
else if (app.id == WEBEXTENSIONS_ID) {
|
||||||
version = WEBEXTENSIONS_VERSION
|
// For WebExtensions, report as Firefox 128.0
|
||||||
|
version = "128.0";
|
||||||
|
}
|
||||||
|
|
||||||
// Only extensions and dictionaries can be compatible by default; themes
|
// Only extensions and dictionaries can be compatible by default; themes
|
||||||
// and language packs always use strict compatibility checking.
|
// and language packs always use strict compatibility checking.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue