commit 3d2c49cd64cc36b2145ff64100e12ae397cb9885
parent ee6e36ad2f05d7924770dd233e5aac67cff1ff14
Author: Rob Wu <rob@robwu.nl>
Date: Fri, 9 Jan 2026 14:40:06 +0000
Bug 2008933 - Use same definition of "Nightly" across compatibility checks r=willdurand
The MOZ_COMPATIBILITY_NIGHTLY constant was introduced as a replacement
for a preprocessor variable in bug 1226386, which was a 1:1 replacement
of the original logic at
https://searchfox.org/firefox-main/diff/06f022b38fa43a8e0db74c7ea5bf897c8c8fbc30/toolkit/mozapps/extensions/moz.build#48
That original logic predates the existence of the NIGHTLY_BUILD
constant. But now we have it, let's use it for consistency.
Differential Revision: https://phabricator.services.mozilla.com/D278146
Diffstat:
3 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/toolkit/mozapps/extensions/AddonManager.sys.mjs b/toolkit/mozapps/extensions/AddonManager.sys.mjs
@@ -17,13 +17,6 @@ if ("@mozilla.org/xre/app-info;1" in Cc) {
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
-const MOZ_COMPATIBILITY_NIGHTLY = ![
- "aurora",
- "beta",
- "release",
- "esr",
-].includes(AppConstants.MOZ_UPDATE_CHANNEL);
-
const INTL_LOCALES_CHANGED = "intl:app-locales-changed";
const XPIPROVIDER_BLOCKLIST_ATTENTION_UPDATED =
"xpi-provider:blocklist-attention-updated";
@@ -57,7 +50,7 @@ const UPDATE_REQUEST_VERSION = 2;
const BRANCH_REGEXP = /^([^\.]+\.[0-9]+[a-z]*).*/gi;
const PREF_EM_CHECK_COMPATIBILITY_BASE = "extensions.checkCompatibility";
-var PREF_EM_CHECK_COMPATIBILITY = MOZ_COMPATIBILITY_NIGHTLY
+var PREF_EM_CHECK_COMPATIBILITY = AppConstants.NIGHTLY_BUILD
? PREF_EM_CHECK_COMPATIBILITY_BASE + ".nightly"
: undefined;
@@ -689,7 +682,7 @@ var AddonManagerInternal = {
);
}
- if (!MOZ_COMPATIBILITY_NIGHTLY) {
+ if (!AppConstants.NIGHTLY_BUILD) {
PREF_EM_CHECK_COMPATIBILITY =
PREF_EM_CHECK_COMPATIBILITY_BASE +
"." +
diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -341,17 +341,6 @@ var BootstrapMonitor = {
},
};
-function isNightlyChannel() {
- var channel = Services.prefs.getCharPref("app.update.channel", "default");
-
- return (
- channel != "aurora" &&
- channel != "beta" &&
- channel != "release" &&
- channel != "esr"
- );
-}
-
async function restartWithLocales(locales) {
Services.locale.requestedLocales = locales;
await promiseRestartManager();
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js b/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js
@@ -129,7 +129,7 @@ add_task(async function setup() {
Assert.ok(Services.prefs.getBoolPref("extensions.strictCompatibility"));
// AddonManager.checkCompatibility
- if (isNightlyChannel()) {
+ if (AppConstants.NIGHTLY_BUILD) {
var version = "nightly";
} else {
version = Services.appinfo.version.replace(