forked from mirrors/gecko-dev
Bug 1897321 - Add minVersion variable to whatsNewPage Nimbus feature r=omc-reviewers,firefox-desktop-core-reviewers ,aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D211892
This commit is contained in:
parent
82329d580f
commit
868833e264
3 changed files with 22 additions and 3 deletions
|
|
@ -3062,7 +3062,9 @@ pref("browser.backup.sqlite.step_delay_ms", 250);
|
||||||
pref("browser.profiles.enabled", false);
|
pref("browser.profiles.enabled", false);
|
||||||
|
|
||||||
pref("startup.homepage_override_url_nimbus", "");
|
pref("startup.homepage_override_url_nimbus", "");
|
||||||
|
// These prefs are referring to the Fx update version
|
||||||
pref("startup.homepage_override_nimbus_maxVersion", "");
|
pref("startup.homepage_override_nimbus_maxVersion", "");
|
||||||
|
pref("startup.homepage_override_nimbus_minVersion", "");
|
||||||
|
|
||||||
// Pref to enable the content relevancy feature.
|
// Pref to enable the content relevancy feature.
|
||||||
pref("toolkit.contentRelevancy.enabled", false);
|
pref("toolkit.contentRelevancy.enabled", false);
|
||||||
|
|
|
||||||
|
|
@ -750,17 +750,28 @@ nsBrowserContentHandler.prototype = {
|
||||||
const nimbusOverrideUrl = Services.urlFormatter.formatURLPref(
|
const nimbusOverrideUrl = Services.urlFormatter.formatURLPref(
|
||||||
"startup.homepage_override_url_nimbus"
|
"startup.homepage_override_url_nimbus"
|
||||||
);
|
);
|
||||||
|
// This defines the maximum allowed Fx update version to see the
|
||||||
|
// nimbus WNP. For ex, if maxVersion is set to 127 but user updates
|
||||||
|
// to 128, they will not qualify.
|
||||||
const maxVersion = Services.prefs.getCharPref(
|
const maxVersion = Services.prefs.getCharPref(
|
||||||
"startup.homepage_override_nimbus_maxVersion",
|
"startup.homepage_override_nimbus_maxVersion",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
|
// This defines the minimum allowed Fx update version to see the
|
||||||
|
// nimbus WNP. For ex, if minVersion is set to 126 but user updates
|
||||||
|
// to 124, they will not qualify.
|
||||||
|
const minVersion = Services.prefs.getCharPref(
|
||||||
|
"startup.homepage_override_nimbus_minVersion",
|
||||||
|
""
|
||||||
|
);
|
||||||
let nimbusWNP;
|
let nimbusWNP;
|
||||||
|
|
||||||
// Update version should be less than or equal to maxVersion set by
|
// The update version should be less than or equal to maxVersion and
|
||||||
// the experiment
|
// greater or equal to minVersion set by the experiment.
|
||||||
if (
|
if (
|
||||||
nimbusOverrideUrl &&
|
nimbusOverrideUrl &&
|
||||||
Services.vc.compare(update.appVersion, maxVersion) <= 0
|
Services.vc.compare(update.appVersion, maxVersion) <= 0 &&
|
||||||
|
Services.vc.compare(update.appVersion, minVersion) >= 0
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
let uri = Services.io.newURI(nimbusOverrideUrl);
|
let uri = Services.io.newURI(nimbusOverrideUrl);
|
||||||
|
|
|
||||||
|
|
@ -1338,6 +1338,12 @@ whatsNewPage:
|
||||||
setPref:
|
setPref:
|
||||||
branch: user
|
branch: user
|
||||||
pref: startup.homepage_override_nimbus_maxVersion
|
pref: startup.homepage_override_nimbus_maxVersion
|
||||||
|
minVersion:
|
||||||
|
description: Minimum Firefox update version
|
||||||
|
type: string
|
||||||
|
setPref:
|
||||||
|
branch: user
|
||||||
|
pref: startup.homepage_override_nimbus_minVersion
|
||||||
|
|
||||||
pbNewtab:
|
pbNewtab:
|
||||||
description: "A Firefox Messaging System message for the pbNewtab message channel"
|
description: "A Firefox Messaging System message for the pbNewtab message channel"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue