summaryrefslogtreecommitdiff
path: root/components/addons/src/AddonUpdateChecker.jsm
diff options
context:
space:
mode:
Diffstat (limited to 'components/addons/src/AddonUpdateChecker.jsm')
-rw-r--r--components/addons/src/AddonUpdateChecker.jsm28
1 files changed, 28 insertions, 0 deletions
diff --git a/components/addons/src/AddonUpdateChecker.jsm b/components/addons/src/AddonUpdateChecker.jsm
index b09c221a8..4a8e0f3e7 100644
--- a/components/addons/src/AddonUpdateChecker.jsm
+++ b/components/addons/src/AddonUpdateChecker.jsm
@@ -25,6 +25,7 @@ const XMLURI_PARSE_ERROR = "http://www.mozilla.org/newlayout/xml/pa
const TOOLKIT_ID = "toolkit@mozilla.org";
const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
+const FIREFOX_APPCOMPATVERSION = "56.9";
const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
const PREF_EM_MIN_COMPAT_APP_VERSION = "extensions.minCompatibleAppVersion";
@@ -522,6 +523,18 @@ function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
maxVersion: getRequiredProperty(app, "max_version", "string"),
}
}
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ else if (FIREFOX_ID in applications) {
+ logger.debug("update.json: Dual-GUID targetApplication");
+ app = getProperty(applications, FIREFOX_ID, "object");
+
+ appEntry = {
+ id: FIREFOX_ID,
+ minVersion: getRequiredProperty(app, "min_version", "string"),
+ maxVersion: getRequiredProperty(app, "max_version", "string"),
+ }
+ }
+#endif
else if (TOOLKIT_ID in applications) {
logger.debug("update.json: Toolkit targetApplication");
app = getProperty(applications, TOOLKIT_ID, "object");
@@ -545,7 +558,11 @@ function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
id: TOOLKIT_ID,
minVersion: platformVersion,
#endif
+#if defined(MOZ_PHOENIX) && defined(MOZ_PHOENIX_EXTENSIONS)
+ maxVersion: FIREFOX_APPCOMPATVERSION,
+#else
maxVersion: '*',
+#endif
};
}
else {
@@ -808,6 +825,12 @@ function matchesVersions(aUpdate, aAppVersion, aPlatformVersion,
return (Services.vc.compare(aAppVersion, app.minVersion) >= 0) &&
(aIgnoreMaxVersion || (Services.vc.compare(aAppVersion, app.maxVersion) <= 0));
}
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ if (app.id == FIREFOX_ID) {
+ return (Services.vc.compare(aAppVersion, app.minVersion) >= 0) &&
+ (aIgnoreMaxVersion || (Services.vc.compare(aAppVersion, app.maxVersion) <= 0));
+ }
+#endif
if (app.id == TOOLKIT_ID) {
result = (Services.vc.compare(aPlatformVersion, app.minVersion) >= 0) &&
(aIgnoreMaxVersion || (Services.vc.compare(aPlatformVersion, app.maxVersion) <= 0));
@@ -865,7 +888,12 @@ this.AddonUpdateChecker = {
if (aIgnoreCompatibility) {
for (let targetApp of update.targetApplications) {
let id = targetApp.id;
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ if (id == Services.appinfo.ID || id == FIREFOX_ID ||
+ id == TOOLKIT_ID)
+#else
if (id == Services.appinfo.ID || id == TOOLKIT_ID)
+#endif
return update;
}
}