--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -25,19 +25,16 @@ pref("browser.chromeURL","chrome://brows
pref("browser.hiddenWindowChromeURL", "chrome://browser/content/hiddenWindow.xul");
// Enables some extra Extension System Logging (can reduce performance)
pref("extensions.logging.enabled", false);
// Disables strict compatibility, making addons compatible-by-default.
pref("extensions.strictCompatibility", false);
-// Specifies a minimum maxVersion an addon needs to say it's compatible with
-// for it to be compatible by default.
-pref("extensions.minCompatibleAppVersion", "4.0");
// Temporary preference to forcibly make themes more safe with Australis even if
// extensions.checkCompatibility=false has been set.
pref("extensions.checkCompatibility.temporaryThemeOverride_minAppVersion", "29.0a1");
pref("xpinstall.customConfirmationUI", true);
pref("extensions.webextPermissionPrompts", true);
pref("extensions.webextOptionalPermissionPrompts", true);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4918,17 +4918,16 @@ pref("browser.history.maxStateObjectSize
pref("browser.meta_refresh_when_inactive.disabled", false);
// XPInstall prefs
pref("xpinstall.whitelist.required", true);
// Only Firefox requires add-on signatures
pref("xpinstall.signatures.required", false);
pref("extensions.langpacks.signatures.required", false);
-pref("extensions.minCompatiblePlatformVersion", "2.0");
pref("extensions.webExtensionsMinPlatformVersion", "42.0a1");
pref("extensions.legacy.enabled", true);
// Other webextensions prefs
pref("extensions.webextensions.keepStorageOnUninstall", false);
pref("extensions.webextensions.keepUuidOnUninstall", false);
// Redirect basedomain used by identity api
pref("extensions.webextensions.identity.redirectDomain", "extensions.allizom.org");
--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm
@@ -470,27 +470,16 @@ class AddonInternal {
if (overrides) {
let override = AddonRepository.findMatchingCompatOverride(this.version,
overrides);
if (override) {
return false;
}
}
- // Extremely old extensions should not be compatible by default.
- let minCompatVersion;
- if (app.id == Services.appinfo.ID)
- minCompatVersion = XPIProvider.minCompatibleAppVersion;
- else if (app.id == TOOLKIT_ID)
- minCompatVersion = XPIProvider.minCompatiblePlatformVersion;
-
- if (minCompatVersion &&
- Services.vc.compare(minCompatVersion, maxVersion) > 0)
- return false;
-
return Services.vc.compare(version, minVersion) >= 0;
}
return (Services.vc.compare(version, minVersion) >= 0) &&
(Services.vc.compare(version, maxVersion) <= 0);
}
get matchingTargetApplication() {
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -65,19 +65,16 @@ const PREF_EM_STARTUP_SCAN_SCOPES =
const PREF_XPI_SIGNATURES_REQUIRED = "xpinstall.signatures.required";
const PREF_LANGPACK_SIGNATURES = "extensions.langpacks.signatures.required";
const PREF_XPI_PERMISSIONS_BRANCH = "xpinstall.";
const PREF_INSTALL_DISTRO_ADDONS = "extensions.installDistroAddons";
const PREF_BRANCH_INSTALLED_ADDON = "extensions.installedDistroAddon.";
const PREF_SYSTEM_ADDON_SET = "extensions.systemAddonSet";
const PREF_ALLOW_LEGACY = "extensions.legacy.enabled";
-const PREF_EM_MIN_COMPAT_APP_VERSION = "extensions.minCompatibleAppVersion";
-const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVersion";
-
const PREF_EM_LAST_APP_BUILD_ID = "extensions.lastAppBuildId";
// Specify a list of valid built-in add-ons to load.
const BUILT_IN_ADDONS_URI = "chrome://browser/content/built_in_addons.json";
const OBSOLETE_PREFERENCES = [
"extensions.bootstrappedAddons",
"extensions.enabledAddons",
@@ -1652,20 +1649,16 @@ var XPIProvider = {
},
BOOTSTRAP_REASONS: Object.freeze(BOOTSTRAP_REASONS),
// An array of known install locations
installLocations: null,
// A dictionary of known install locations by name
installLocationsByName: null,
- // The value of the minCompatibleAppVersion preference
- minCompatibleAppVersion: null,
- // The value of the minCompatiblePlatformVersion preference
- minCompatiblePlatformVersion: null,
// A Map of active addons to their bootstrapScope by ID
activeAddons: new Map(),
// True if the platform could have activated extensions
extensionsActive: false,
// New distribution addons awaiting permissions approval
newDistroAddons: null,
// Keep track of startup phases for telemetry
runPhase: XPI_STARTING,
@@ -1898,23 +1891,16 @@ var XPIProvider = {
// Clear this at startup for xpcshell test restarts
this._telemetryDetails = {};
// Register our details structure with AddonManager
AddonManagerPrivate.setTelemetryDetails("XPI", this._telemetryDetails);
this.setupInstallLocations(aAppChanged);
- this.minCompatibleAppVersion = Services.prefs.getStringPref(PREF_EM_MIN_COMPAT_APP_VERSION,
- null);
- this.minCompatiblePlatformVersion = Services.prefs.getStringPref(PREF_EM_MIN_COMPAT_PLATFORM_VERSION,
- null);
-
- Services.prefs.addObserver(PREF_EM_MIN_COMPAT_APP_VERSION, this);
- Services.prefs.addObserver(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, this);
if (!AppConstants.MOZ_REQUIRE_SIGNING || Cu.isInAutomation)
Services.prefs.addObserver(PREF_XPI_SIGNATURES_REQUIRED, this);
Services.prefs.addObserver(PREF_LANGPACK_SIGNATURES, this);
Services.prefs.addObserver(PREF_ALLOW_LEGACY, this);
Services.obs.addObserver(this, NOTIFICATION_FLUSH_PERMISSIONS);
Services.obs.addObserver(this, NOTIFICATION_TOOLBOX_CONNECTION_CHANGE);
@@ -2702,26 +2688,16 @@ var XPIProvider = {
return;
} else if (aTopic == NOTIFICATION_TOOLBOX_CONNECTION_CHANGE) {
this.onDebugConnectionChange(aSubject.wrappedJSObject);
return;
}
if (aTopic == "nsPref:changed") {
switch (aData) {
- case PREF_EM_MIN_COMPAT_APP_VERSION:
- this.minCompatibleAppVersion = Services.prefs.getStringPref(PREF_EM_MIN_COMPAT_APP_VERSION,
- null);
- this.updateAddonAppDisabledStates();
- break;
- case PREF_EM_MIN_COMPAT_PLATFORM_VERSION:
- this.minCompatiblePlatformVersion = Services.prefs.getStringPref(PREF_EM_MIN_COMPAT_PLATFORM_VERSION,
- null);
- this.updateAddonAppDisabledStates();
- break;
case PREF_XPI_SIGNATURES_REQUIRED:
case PREF_LANGPACK_SIGNATURES:
case PREF_ALLOW_LEGACY:
this.updateAddonAppDisabledStates();
break;
}
}
},
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -8,18 +8,16 @@ if (!_TEST_FILE[0].includes("toolkit/moz
ok(false, ("head_addons.js may not be loaded by tests outside of " +
"the add-on manager component."));
}
Cu.importGlobalProperties(["TextEncoder"]);
const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility";
-const PREF_EM_MIN_COMPAT_APP_VERSION = "extensions.minCompatibleAppVersion";
-const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVersion";
const PREF_GETADDONS_BYIDS = "extensions.getAddons.get.url";
const PREF_COMPAT_OVERRIDES = "extensions.getAddons.compatOverides.url";
const PREF_XPI_SIGNATURES_REQUIRED = "xpinstall.signatures.required";
const PREF_SYSTEM_ADDON_SET = "extensions.systemAddonSet";
const PREF_SYSTEM_ADDON_UPDATE_URL = "extensions.systemAddon.update.url";
const PREF_APP_UPDATE_ENABLED = "app.update.enabled";
const PREF_DISABLE_SECURITY = ("security.turn_off_all_security_so_that_" +
"viruses_can_take_over_this_computer");
@@ -1122,20 +1120,16 @@ function promiseInstallWebExtension(aDat
return installs[0].addon;
return promise.then(() => installs[0].addon);
});
}
// By default use strict compatibility
Services.prefs.setBoolPref("extensions.strictCompatibility", true);
-// By default, set min compatible versions to 0
-Services.prefs.setCharPref(PREF_EM_MIN_COMPAT_APP_VERSION, "0");
-Services.prefs.setCharPref(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, "0");
-
// Ensure signature checks are enabled by default
Services.prefs.setBoolPref(PREF_XPI_SIGNATURES_REQUIRED, true);
Services.prefs.setBoolPref("extensions.legacy.enabled", true);
// Copies blocklistFile (an nsIFile) to gProfD/blocklist.xml.
function copyBlocklistToProfile(blocklistFile) {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_strictcompatibility.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_strictcompatibility.js
@@ -20,17 +20,20 @@ const ADDONS = {
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
},
expected: {
strictCompatibility: false,
},
- compatible: [true, true, true, true],
+ compatible: {
+ nonStrict: true,
+ strict: true,
+ },
},
// Incompatible in strict compatibility mode
"addon2@tests.mozilla.org": {
"install.rdf": {
id: "addon2@tests.mozilla.org",
version: "1.0",
name: "Test 2",
@@ -39,17 +42,20 @@ const ADDONS = {
id: "xpcshell@tests.mozilla.org",
minVersion: "0.7",
maxVersion: "0.8"
}]
},
expected: {
strictCompatibility: false,
},
- compatible: [false, true, false, true],
+ compatible: {
+ nonStrict: true,
+ strict: false,
+ },
},
// Opt-in to strict compatibility - always incompatible
"addon4@tests.mozilla.org": {
"install.rdf": {
id: "addon4@tests.mozilla.org",
version: "1.0",
name: "Test 4",
@@ -59,17 +65,20 @@ const ADDONS = {
id: "xpcshell@tests.mozilla.org",
minVersion: "0.8",
maxVersion: "0.9"
}]
},
expected: {
strictCompatibility: true,
},
- compatible: [false, false, false, false],
+ compatible: {
+ nonStrict: false,
+ strict: false,
+ },
},
// Addon from the future - would be marked as compatibile-by-default,
// but minVersion is higher than the app version
"addon5@tests.mozilla.org": {
"install.rdf": {
id: "addon5@tests.mozilla.org",
version: "1.0",
@@ -79,17 +88,20 @@ const ADDONS = {
id: "xpcshell@tests.mozilla.org",
minVersion: "3",
maxVersion: "5"
}]
},
expected: {
strictCompatibility: false,
},
- compatible: [false, false, false, false],
+ compatible: {
+ nonStrict: false,
+ strict: false,
+ },
},
// Extremely old addon - maxVersion is less than the minimum compat version
// set in extensions.minCompatibleVersion
"addon6@tests.mozilla.org": {
"install.rdf": {
id: "addon6@tests.mozilla.org",
version: "1.0",
@@ -99,17 +111,20 @@ const ADDONS = {
id: "xpcshell@tests.mozilla.org",
minVersion: "0.1",
maxVersion: "0.2"
}]
},
expected: {
strictCompatibility: false,
},
- compatible: [false, true, false, false],
+ compatible: {
+ nonStrict: true,
+ strict: false,
+ },
},
// Dictionary - incompatible in strict compatibility mode
"addon7@tests.mozilla.org": {
"install.rdf": {
id: "addon7@tests.mozilla.org",
version: "1.0",
name: "Test 7",
@@ -118,17 +133,20 @@ const ADDONS = {
id: "xpcshell@tests.mozilla.org",
minVersion: "0.8",
maxVersion: "0.9"
}]
},
expected: {
strictCompatibility: false,
},
- compatible: [false, true, false, true],
+ compatible: {
+ nonStrict: true,
+ strict: false,
+ },
},
};
const IDS = Object.keys(ADDONS);
const profileDir = gProfD.clone();
profileDir.append("extensions");
@@ -149,47 +167,33 @@ async function checkCompatStatus(strict,
add_task(async function setup() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
for (let addon of Object.values(ADDONS)) {
await promiseWriteInstallRDFForExtension(addon["install.rdf"], profileDir);
}
- Services.prefs.setCharPref(PREF_EM_MIN_COMPAT_APP_VERSION, "0.1");
-
await promiseStartupManager();
});
-add_task(async function test_0() {
- // Should default to enabling strict compat.
- await checkCompatStatus(true, 0);
-});
-
add_task(async function test_1() {
info("Test 1");
Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
- await checkCompatStatus(false, 1);
+ await checkCompatStatus(false, "nonStrict");
await promiseRestartManager();
- await checkCompatStatus(false, 1);
+ await checkCompatStatus(false, "nonStrict");
});
add_task(async function test_2() {
info("Test 2");
Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
- await checkCompatStatus(true, 2);
+ await checkCompatStatus(true, "strict");
await promiseRestartManager();
- await checkCompatStatus(true, 2);
-});
-
-add_task(async function test_3() {
- info("Test 3");
- Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
- Services.prefs.setCharPref(PREF_EM_MIN_COMPAT_APP_VERSION, "0.4");
- await checkCompatStatus(false, 3);
+ await checkCompatStatus(true, "strict");
});
const CHECK_COMPAT_ADDONS = {
"cc-addon1@tests.mozilla.org": {
"install.rdf": {
// Cannot be enabled as it has no target app info for the applciation
id: "cc-addon1@tests.mozilla.org",
version: "1.0",