mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
[WebExAM] Issue #402 - Make JSON update manifests assume Firefox instead of Toolkit
This commit is contained in:
parent
7c5d4769d8
commit
d300380db0
2 changed files with 14 additions and 5 deletions
|
|
@ -26,6 +26,12 @@ const XMLURI_PARSE_ERROR = "http://www.mozilla.org/newlayout/xml/parsererror.
|
||||||
|
|
||||||
const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
|
const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
|
||||||
|
|
||||||
|
#ifdef MOZ_PHOENIX
|
||||||
|
const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVersion";
|
||||||
|
const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
|
||||||
|
const FIREFOX_APPCOMPATVERSION = "56.9"
|
||||||
|
#endif
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
|
||||||
|
|
@ -446,6 +452,10 @@ function parseRDFManifest(aId, aUpdateKey, aRequest, aManifestData) {
|
||||||
* @throws if the update manifest is invalid in any way
|
* @throws if the update manifest is invalid in any way
|
||||||
*/
|
*/
|
||||||
function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
|
function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
|
||||||
|
#ifndef MOZ_PHOENIX
|
||||||
|
throw Components.Exception("This application does not support JSON update manifests");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (aUpdateKey)
|
if (aUpdateKey)
|
||||||
throw Components.Exception("Update keys are not supported for JSON update manifests");
|
throw Components.Exception("Update keys are not supported for JSON update manifests");
|
||||||
|
|
||||||
|
|
@ -515,10 +525,10 @@ function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
|
||||||
let app = getProperty(applications, "gecko", "object");
|
let app = getProperty(applications, "gecko", "object");
|
||||||
|
|
||||||
let appEntry = {
|
let appEntry = {
|
||||||
id: TOOLKIT_ID,
|
id: FIREFOX_ID,
|
||||||
minVersion: getProperty(app, "strict_min_version", "string",
|
minVersion: getProperty(app, "strict_min_version", "string",
|
||||||
AddonManagerPrivate.webExtensionsMinPlatformVersion),
|
Services.prefs.getCharPref(PREF_EM_MIN_COMPAT_PLATFORM_VERSION)),
|
||||||
maxVersion: "*",
|
maxVersion: FIREFOX_APPCOMPATVERSION,
|
||||||
};
|
};
|
||||||
|
|
||||||
let result = {
|
let result = {
|
||||||
|
|
@ -539,7 +549,6 @@ function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
appEntry.maxVersion = getProperty(app, "strict_max_version", "string");
|
appEntry.maxVersion = getProperty(app, "strict_max_version", "string");
|
||||||
result.strictCompatibility = appEntry.maxVersion != "*";
|
|
||||||
} else if ("advisory_max_version" in app) {
|
} else if ("advisory_max_version" in app) {
|
||||||
appEntry.maxVersion = getProperty(app, "advisory_max_version", "string");
|
appEntry.maxVersion = getProperty(app, "advisory_max_version", "string");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ EXTRA_JS_MODULES.addons += [
|
||||||
'AddonLogging.jsm',
|
'AddonLogging.jsm',
|
||||||
'AddonRepository.jsm',
|
'AddonRepository.jsm',
|
||||||
'AddonRepository_SQLiteMigrator.jsm',
|
'AddonRepository_SQLiteMigrator.jsm',
|
||||||
'AddonUpdateChecker.jsm',
|
|
||||||
'APIExtensionBootstrap.js',
|
'APIExtensionBootstrap.js',
|
||||||
'Content.js',
|
'Content.js',
|
||||||
'E10SAddonsRollout.jsm',
|
'E10SAddonsRollout.jsm',
|
||||||
|
|
@ -33,4 +32,5 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
|
||||||
|
|
||||||
EXTRA_PP_JS_MODULES.addons += [
|
EXTRA_PP_JS_MODULES.addons += [
|
||||||
'AddonConstants.jsm',
|
'AddonConstants.jsm',
|
||||||
|
'AddonUpdateChecker.jsm',
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue