diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/components/nimbus/lib | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/nimbus/lib')
-rw-r--r-- | toolkit/components/nimbus/lib/ExperimentManager.sys.mjs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/toolkit/components/nimbus/lib/ExperimentManager.sys.mjs b/toolkit/components/nimbus/lib/ExperimentManager.sys.mjs index d0f313a2ae..8bd847b067 100644 --- a/toolkit/components/nimbus/lib/ExperimentManager.sys.mjs +++ b/toolkit/components/nimbus/lib/ExperimentManager.sys.mjs @@ -95,8 +95,8 @@ export class _ExperimentManager { get studiesEnabled() { return ( - Services.prefs.getBoolPref(UPLOAD_ENABLED_PREF) && - Services.prefs.getBoolPref(STUDIES_OPT_OUT_PREF) + Services.prefs.getBoolPref(UPLOAD_ENABLED_PREF, false) && + Services.prefs.getBoolPref(STUDIES_OPT_OUT_PREF, false) ); } @@ -974,7 +974,7 @@ export class _ExperimentManager { // need to check if we have another enrollment for the same feature. const conflictingEnrollment = getConflictingEnrollment(featureId); - for (const [variable, value] of Object.entries(featureValue)) { + for (let [variable, value] of Object.entries(featureValue)) { const setPref = feature.getSetPref(variable); if (setPref) { @@ -1012,6 +1012,13 @@ export class _ExperimentManager { // An experiment takes precedence if there is already a pref set. if (!isRollout || !conflictingPref) { + if ( + lazy.NimbusFeatures[featureId].manifest.variables[variable] + .type === "json" + ) { + value = JSON.stringify(value); + } + prefsToSet.push({ name: prefName, value, @@ -1250,7 +1257,13 @@ export class _ExperimentManager { } } - const value = featuresById[featureId].value[variable]; + let value = featuresById[featureId].value[variable]; + if ( + lazy.NimbusFeatures[featureId].manifest.variables[variable].type === + "json" + ) { + value = JSON.stringify(value); + } if (prefBranch !== "user") { lazy.PrefUtils.setPref(name, value, { branch: prefBranch }); |