Bug 1883673 - Remove majorRelease2022 Nimbus feature r=aminomancer,omc-reviewers,win-reviewers,gstoll,pbz,firefox-desktop-core-reviewers

This feature is no longer intended for experimentation and some of the things
it controls are no longer in product.

Differential Revision: https://phabricator.services.mozilla.com/D204514
This commit is contained in:
Barret Rennie
2024-04-24 20:15:19 +00:00
parent 788dc6f278
commit 0633e0cca7
15 changed files with 22 additions and 263 deletions

View File

@@ -823,10 +823,6 @@ pref("browser.privatebrowsing.vpnpromourl", "https://vpn.mozilla.org/?utm_source
// Whether the user has opted-in to recommended settings for data features. // Whether the user has opted-in to recommended settings for data features.
pref("browser.dataFeatureRecommendations.enabled", false); pref("browser.dataFeatureRecommendations.enabled", false);
// Temporary pref to control whether or not Private Browsing windows show up
// as separate icons in the Windows taskbar.
pref("browser.privateWindowSeparation.enabled", true);
// Use dark theme variant for PBM windows. This is only supported if the theme // Use dark theme variant for PBM windows. This is only supported if the theme
// sets darkTheme data. // sets darkTheme data.
pref("browser.theme.dark-private-windows", true); pref("browser.theme.dark-private-windows", true);

View File

@@ -322,12 +322,7 @@ function openBrowserWindow(
Ci.nsILoadContext Ci.nsILoadContext
).usePrivateBrowsing = true; ).usePrivateBrowsing = true;
if ( if (AppConstants.platform == "win") {
AppConstants.platform == "win" &&
lazy.NimbusFeatures.majorRelease2022.getVariable(
"feltPrivacyWindowSeparation"
)
) {
lazy.WinTaskbar.setGroupIdForWindow( lazy.WinTaskbar.setGroupIdForWindow(
win, win,
lazy.WinTaskbar.defaultPrivateGroupId lazy.WinTaskbar.defaultPrivateGroupId

View File

@@ -2710,12 +2710,6 @@ BrowserGlue.prototype = {
name: "ensurePrivateBrowsingShortcutExists", name: "ensurePrivateBrowsingShortcutExists",
condition: condition:
AppConstants.platform == "win" && AppConstants.platform == "win" &&
// Pref'ed off until Private Browsing window separation is enabled by default
// to avoid a situation where a user pins the Private Browsing shortcut to
// the Taskbar, which will end up launching into a different Taskbar icon.
lazy.NimbusFeatures.majorRelease2022.getVariable(
"feltPrivacyWindowSeparation"
) &&
// We don't want a shortcut if it's been disabled, eg: by enterprise policy. // We don't want a shortcut if it's been disabled, eg: by enterprise policy.
lazy.PrivateBrowsingUtils.enabled && lazy.PrivateBrowsingUtils.enabled &&
// Private Browsing shortcuts for packaged builds come with the package, // Private Browsing shortcuts for packaged builds come with the package,
@@ -4534,10 +4528,7 @@ BrowserGlue.prototype = {
return "disallow-postUpdate"; return "disallow-postUpdate";
} }
const useMROnboarding =
lazy.NimbusFeatures.majorRelease2022.getVariable("onboarding");
const showUpgradeDialog = const showUpgradeDialog =
useMROnboarding ??
lazy.NimbusFeatures.upgradeDialog.getVariable("enabled"); lazy.NimbusFeatures.upgradeDialog.getVariable("enabled");
return showUpgradeDialog ? "" : "disabled"; return showUpgradeDialog ? "" : "disabled";

View File

@@ -34,7 +34,6 @@ Please note that some targeting attributes require stricter controls on the tele
* [hasMigratedPasswords](#hasmigratedpasswords) * [hasMigratedPasswords](#hasmigratedpasswords)
* [hasPinnedTabs](#haspinnedtabs) * [hasPinnedTabs](#haspinnedtabs)
* [homePageSettings](#homepagesettings) * [homePageSettings](#homepagesettings)
* [inMr2022Holdback](#inmr2022holdback)
* [isBackgroundTaskMode](#isbackgroundtaskmode) * [isBackgroundTaskMode](#isbackgroundtaskmode)
* [isChinaRepack](#ischinarepack) * [isChinaRepack](#ischinarepack)
* [isDefaultBrowser](#isdefaultbrowser) * [isDefaultBrowser](#isdefaultbrowser)
@@ -973,10 +972,6 @@ mode, or `null` if this invocation is not running in background task mode.
Checks if user prefers reduced motion as indicated by the value of a media query for `prefers-reduced-motion`. Checks if user prefers reduced motion as indicated by the value of a media query for `prefers-reduced-motion`.
### `inMr2022Holdback`
A boolean. `true` when the user is in the Major Release 2022 holdback study.
### `distributionId` ### `distributionId`
A string containing the id of the distribution, or the empty string if there A string containing the id of the distribution, or the empty string if there

View File

@@ -45,7 +45,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
ClientEnvironment: "resource://normandy/lib/ClientEnvironment.sys.mjs", ClientEnvironment: "resource://normandy/lib/ClientEnvironment.sys.mjs",
CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs",
HomePage: "resource:///modules/HomePage.sys.mjs", HomePage: "resource:///modules/HomePage.sys.mjs",
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs", ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs",
TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs", TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs",
@@ -891,15 +890,6 @@ const TargetingGetters = {
return window?.matchMedia("(prefers-reduced-motion: reduce)")?.matches; return window?.matchMedia("(prefers-reduced-motion: reduce)")?.matches;
}, },
/**
* Whether or not the user is in the Major Release 2022 holdback study.
*/
get inMr2022Holdback() {
return (
lazy.NimbusFeatures.majorRelease2022.getVariable("onboarding") === false
);
},
/** /**
* The distribution id, if any. * The distribution id, if any.
* @return {string} * @return {string}

View File

@@ -157,7 +157,7 @@ const MESSAGES = () => {
// Add the highest possible cap to ensure impressions are recorded while allowing the Spotlight to sync across windows/tabs with Firefox View open // Add the highest possible cap to ensure impressions are recorded while allowing the Spotlight to sync across windows/tabs with Firefox View open
lifetime: 100, lifetime: 100,
}, },
targeting: `!inMr2022Holdback && source == "about:firefoxview" && targeting: `source == "about:firefoxview" &&
!'browser.newtabpage.activity-stream.asrouter.providers.cfr'|preferenceIsUserSet && !'browser.newtabpage.activity-stream.asrouter.providers.cfr'|preferenceIsUserSet &&
'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features'|preferenceValue && 'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features'|preferenceValue &&
${matchCurrentScreenTargeting( ${matchCurrentScreenTargeting(
@@ -303,7 +303,7 @@ const MESSAGES = () => {
], ],
}, },
priority: 3, priority: 3,
targeting: `!inMr2022Holdback && source == "about:firefoxview" && ${matchCurrentScreenTargeting( targeting: `source == "about:firefoxview" && ${matchCurrentScreenTargeting(
FIREFOX_VIEW_PREF, FIREFOX_VIEW_PREF,
"FEATURE_CALLOUT_[0-9]" "FEATURE_CALLOUT_[0-9]"
)} && ${matchIncompleteTargeting(FIREFOX_VIEW_PREF)}`, )} && ${matchIncompleteTargeting(FIREFOX_VIEW_PREF)}`,
@@ -376,7 +376,7 @@ const MESSAGES = () => {
], ],
}, },
priority: 2, priority: 2,
targeting: `!inMr2022Holdback && source == "about:firefoxview" && "browser.firefox-view.view-count" | preferenceValue > 2 targeting: `source == "about:firefoxview" && "browser.firefox-view.view-count" | preferenceValue > 2
&& (("identity.fxaccounts.enabled" | preferenceValue == false) || !(("services.sync.engine.tabs" | preferenceValue == true) && ("services.sync.username" | preferenceValue))) && (!messageImpressions.FIREFOX_VIEW_SPOTLIGHT[messageImpressions.FIREFOX_VIEW_SPOTLIGHT | length - 1] || messageImpressions.FIREFOX_VIEW_SPOTLIGHT[messageImpressions.FIREFOX_VIEW_SPOTLIGHT | length - 1] < currentDate|date - ${ONE_DAY_IN_MS})`, && (("identity.fxaccounts.enabled" | preferenceValue == false) || !(("services.sync.engine.tabs" | preferenceValue == true) && ("services.sync.username" | preferenceValue))) && (!messageImpressions.FIREFOX_VIEW_SPOTLIGHT[messageImpressions.FIREFOX_VIEW_SPOTLIGHT | length - 1] || messageImpressions.FIREFOX_VIEW_SPOTLIGHT[messageImpressions.FIREFOX_VIEW_SPOTLIGHT | length - 1] < currentDate|date - ${ONE_DAY_IN_MS})`,
frequency: { frequency: {
lifetime: 1, lifetime: 1,

View File

@@ -24,7 +24,6 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
ShellService: "resource:///modules/ShellService.sys.mjs", ShellService: "resource:///modules/ShellService.sys.mjs",
}); });
@@ -871,7 +870,7 @@ const BASE_MESSAGES = () => [
], ],
lifetime: 12, lifetime: 12,
}, },
targeting: "!inMr2022Holdback && doesAppNeedPrivatePin", targeting: "doesAppNeedPrivatePin",
}, },
{ {
id: "PB_NEWTAB_COOKIE_BANNERS_PROMO", id: "PB_NEWTAB_COOKIE_BANNERS_PROMO",
@@ -1374,9 +1373,8 @@ export const OnboardingMessageProvider = {
return checkDefault && !isDefault; return checkDefault && !isDefault;
}, },
_shouldShowPrivacySegmentationScreen() { _shouldShowPrivacySegmentationScreen() {
// Fall back to pref: browser.privacySegmentation.preferences.show return Services.prefs.getBoolPref(
return lazy.NimbusFeatures.majorRelease2022.getVariable( "browser.privacySegmentation.preferences.show"
"feltPrivacyShowPreferencesSection"
); );
}, },
_doesHomepageNeedReset() { _doesHomepageNeedReset() {

View File

@@ -1226,47 +1226,6 @@ add_task(async function check_userPrefersReducedMotion() {
); );
}); });
add_task(async function test_mr2022Holdback() {
await ExperimentAPI.ready();
ok(
!ASRouterTargeting.Environment.inMr2022Holdback,
"Should not be in holdback (no experiment)"
);
{
const doExperimentCleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "majorRelease2022",
value: {
onboarding: true,
},
});
ok(
!ASRouterTargeting.Environment.inMr2022Holdback,
"Should not be in holdback (onboarding = true)"
);
await doExperimentCleanup();
}
{
const doExperimentCleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "majorRelease2022",
value: {
onboarding: false,
},
});
ok(
ASRouterTargeting.Environment.inMr2022Holdback,
"Should be in holdback (onboarding = false)"
);
await doExperimentCleanup();
}
});
add_task(async function test_distributionId() { add_task(async function test_distributionId() {
is( is(
ASRouterTargeting.Environment.distributionId, ASRouterTargeting.Environment.distributionId,

View File

@@ -3227,8 +3227,8 @@ var gPrivacyPane = {
initDataCollection() { initDataCollection() {
if ( if (
!AppConstants.MOZ_DATA_REPORTING && !AppConstants.MOZ_DATA_REPORTING &&
!NimbusFeatures.majorRelease2022.getVariable( !Services.prefs.getBoolPref(
"feltPrivacyShowPreferencesSection" "browser.privacySegmentation.preferences.show"
) )
) { ) {
// Nothing to control in the data collection section, remove it. // Nothing to control in the data collection section, remove it.
@@ -3255,16 +3255,19 @@ var gPrivacyPane = {
// Section visibility // Section visibility
let section = document.getElementById("privacySegmentationSection"); let section = document.getElementById("privacySegmentationSection");
let updatePrivacySegmentationSectionVisibilityState = () => { let updatePrivacySegmentationSectionVisibilityState = () => {
section.hidden = !NimbusFeatures.majorRelease2022.getVariable( section.hidden = !Services.prefs.getBoolPref(
"feltPrivacyShowPreferencesSection" "browser.privacySegmentation.preferences.show"
); );
}; };
NimbusFeatures.majorRelease2022.onUpdate( Services.prefs.addObserver(
"browser.privacySegmentation.preferences.show",
updatePrivacySegmentationSectionVisibilityState updatePrivacySegmentationSectionVisibilityState
); );
window.addEventListener("unload", () => { window.addEventListener("unload", () => {
NimbusFeatures.majorRelease2022.offUpdate( Services.prefs.removeObserver(
"browser.privacySegmentation.preferences.show",
updatePrivacySegmentationSectionVisibilityState updatePrivacySegmentationSectionVisibilityState
); );
}); });

View File

@@ -54,57 +54,3 @@ add_task(async function test_pin_promo() {
await BrowserTestUtils.closeWindow(win3); await BrowserTestUtils.closeWindow(win3);
await BrowserTestUtils.closeWindow(win4); await BrowserTestUtils.closeWindow(win4);
}); });
add_task(async function test_pin_promo_mr2022_holdback() {
ASRouter.resetMessageState();
// Set majorRelease2022 feature onboarding variable fallback pref
// for inMr2022Holdback targeting to evaluate true
await SpecialPowers.pushPrefEnv({
set: [["browser.majorrelease.onboarding", false]],
});
await ASRouter.onPrefChange();
let { win: win1, tab: tab1 } = await openTabAndWaitForRender();
await SpecialPowers.spawn(tab1, [], async function () {
const promoContainer = content.document.querySelector(".promo");
const promoButton = content.document.querySelector(
"#private-browsing-promo-link"
);
ok(promoContainer, "Promo is shown");
Assert.equal(
promoButton.getAttribute("data-l10n-id"),
"about-private-browsing-focus-promo-cta",
"Pin Promo not shown for holdback user"
);
});
await BrowserTestUtils.closeWindow(win1);
});
add_task(async function test_pin_promo_mr2022_not_holdback() {
ASRouter.resetMessageState();
// Set majorRelease2022 feature onboarding variable fallback pref
// for inMr2022Holdback targeting to evaluate false
await SpecialPowers.pushPrefEnv({
set: [["browser.majorrelease.onboarding", true]],
});
await ASRouter.onPrefChange();
let { win: win1, tab: tab1 } = await openTabAndWaitForRender();
await SpecialPowers.spawn(tab1, [], async function () {
const promoContainer = content.document.querySelector(".promo");
const promoHeader = content.document.getElementById("promo-header");
ok(promoContainer, "Promo is shown");
is(
promoHeader.getAttribute("data-l10n-id"),
"about-private-browsing-pin-promo-header",
"Pin Promo is shown"
);
});
await BrowserTestUtils.closeWindow(win1);
});

View File

@@ -122,83 +122,3 @@ add_task(async function show_major_upgrade() {
defaultPrefs.setBoolPref(pref, orig); defaultPrefs.setBoolPref(pref, orig);
await cleanupUpgrade(); await cleanupUpgrade();
}); });
add_task(async function test_mr2022_upgradeDialogEnabled() {
const FALLBACK_PREF = "browser.startup.upgradeDialog.enabled";
async function runMajorReleaseTest(
{ onboarding = undefined, enabled = undefined, fallbackPref = undefined },
expected
) {
info("Testing upgradeDialog with:");
info(` majorRelease2022.onboarding=${onboarding}`);
info(` upgradeDialog.enabled=${enabled}`);
info(` ${FALLBACK_PREF}=${fallbackPref}`);
let mr2022Cleanup = async () => {};
let upgradeDialogCleanup = async () => {};
if (typeof onboarding !== "undefined") {
mr2022Cleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "majorRelease2022",
value: { onboarding },
});
}
if (typeof enabled !== "undefined") {
upgradeDialogCleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "upgradeDialog",
value: { enabled },
});
}
if (typeof fallbackPref !== "undefined") {
await SpecialPowers.pushPrefEnv({
set: [[FALLBACK_PREF, fallbackPref]],
});
}
const cleanupForcedUpgrade = await forceMajorUpgrade();
try {
await BROWSER_GLUE._maybeShowDefaultBrowserPrompt();
AssertEvents(`Upgrade dialog ${expected ? "shown" : "not shown"}`, [
"trigger",
"reason",
expected ? "satisfied" : "disabled",
]);
if (expected) {
const [win] = await TestUtils.topicObserved("subdialog-loaded");
win.close();
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
}
} finally {
await cleanupForcedUpgrade();
if (typeof fallbackPref !== "undefined") {
await SpecialPowers.popPrefEnv();
}
await upgradeDialogCleanup();
await mr2022Cleanup();
}
}
await runMajorReleaseTest({ onboarding: true }, true);
await runMajorReleaseTest({ onboarding: true, enabled: false }, true);
await runMajorReleaseTest({ onboarding: true, fallbackPref: false }, true);
await runMajorReleaseTest({ onboarding: false }, false);
await runMajorReleaseTest({ onboarding: false, enabled: true }, false);
await runMajorReleaseTest({ onboarding: false, fallbackPref: true }, false);
await runMajorReleaseTest({ enabled: true }, true);
await runMajorReleaseTest({ enabled: true, fallbackPref: false }, true);
await runMajorReleaseTest({ fallbackPref: true }, true);
await runMajorReleaseTest({ enabled: false }, false);
await runMajorReleaseTest({ enabled: false, fallbackPref: true }, false);
await runMajorReleaseTest({ fallbackPref: false }, false);
// Test the default configuration.
await runMajorReleaseTest({}, false);
});

View File

@@ -1434,33 +1434,6 @@ gleanInternalSdk:
branch: user branch: user
pref: telemetry.glean.internal.maxPingsPerMinute pref: telemetry.glean.internal.maxPingsPerMinute
majorRelease2022:
description: Major Release 2022
owner: firefoxview@mozilla.com
hasExposure: false
isEarlyStartup: true
variables:
feltPrivacyPBMDarkTheme:
type: boolean
fallbackPref: "browser.theme.dark-private-windows"
description: "Use dark theme variant for PBM windows. This is only supported if the theme sets darkTheme data."
feltPrivacyShowPreferencesSection:
type: boolean
fallbackPref: "browser.privacySegmentation.preferences.show"
description: "Controls visibility of the privacy segmentation preferences section."
feltPrivacyWindowSeparation:
type: boolean
fallbackPref: "browser.privateWindowSeparation.enabled"
description: "Whether or not private browsing windows use a separate icon in the Windows taskbar"
colorwayCloset:
type: boolean
fallbackPref: "browser.theme.colorway-closet"
description: "Whether or not to show the colorway closet modal"
onboarding:
type: boolean
fallbackPref: "browser.majorrelease.onboarding"
description: "Whether or not to use the MR2022 onboarding settings."
browserLowMemoryPrefs: browserLowMemoryPrefs:
description: Prefs which control the browser's behaviour under low memory. description: Prefs which control the browser's behaviour under low memory.
owner: haftandilian@mozilla.com owner: haftandilian@mozilla.com

View File

@@ -25,7 +25,6 @@ NIMBUS_FALLBACK_PREFS = (
# See https://bugzilla.mozilla.org/show_bug.cgi?id=1875331 for details. # See https://bugzilla.mozilla.org/show_bug.cgi?id=1875331 for details.
ALLOWED_ISEARLYSTARTUP_FEATURE_IDS = { ALLOWED_ISEARLYSTARTUP_FEATURE_IDS = {
"aboutwelcome", "aboutwelcome",
"majorRelease2022",
"newtab", "newtab",
"pocketNewtab", "pocketNewtab",
"searchConfiguration", "searchConfiguration",

View File

@@ -8,7 +8,6 @@ const lazy = {};
// Get the theme variables from the app resource directory. // Get the theme variables from the app resource directory.
// This allows per-app variables. // This allows per-app variables.
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
ThemeContentPropertyList: "resource:///modules/ThemeVariableMap.sys.mjs", ThemeContentPropertyList: "resource:///modules/ThemeVariableMap.sys.mjs",
ThemeVariableMap: "resource:///modules/ThemeVariableMap.sys.mjs", ThemeVariableMap: "resource:///modules/ThemeVariableMap.sys.mjs",
@@ -255,9 +254,7 @@ LightweightThemeConsumer.prototype = {
// If enabled, apply the dark theme variant to private browsing windows. // If enabled, apply the dark theme variant to private browsing windows.
if ( if (
!lazy.NimbusFeatures.majorRelease2022.getVariable( !Services.prefs.getBoolPref("browser.theme.dark-private-windows") ||
"feltPrivacyPBMDarkTheme"
) ||
!lazy.PrivateBrowsingUtils.isWindowPrivate(this._win) || !lazy.PrivateBrowsingUtils.isWindowPrivate(this._win) ||
lazy.PrivateBrowsingUtils.permanentPrivateBrowsing lazy.PrivateBrowsingUtils.permanentPrivateBrowsing
) { ) {

View File

@@ -166,7 +166,6 @@
#include "mozilla/StaticPrefs_ui.h" #include "mozilla/StaticPrefs_ui.h"
#include "mozilla/StaticPrefs_widget.h" #include "mozilla/StaticPrefs_widget.h"
#include "nsNativeAppSupportWin.h" #include "nsNativeAppSupportWin.h"
#include "mozilla/browser/NimbusFeatures.h"
#include "nsIGfxInfo.h" #include "nsIGfxInfo.h"
#include "nsUXThemeConstants.h" #include "nsUXThemeConstants.h"
@@ -989,13 +988,11 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
} }
if (aInitData->mIsPrivate) { if (aInitData->mIsPrivate) {
if (NimbusFeatures::GetBool("majorRelease2022"_ns,
"feltPrivacyWindowSeparation"_ns, true) &&
// Although permanent Private Browsing mode is indeed Private Browsing, // Although permanent Private Browsing mode is indeed Private Browsing,
// we choose to make it look like regular Firefox in terms of the icon // we choose to make it look like regular Firefox in terms of the icon
// it uses (which also means we shouldn't use the Private Browsing // it uses (which also means we shouldn't use the Private Browsing
// AUMID). // AUMID).
!StaticPrefs::browser_privatebrowsing_autostart()) { if (!StaticPrefs::browser_privatebrowsing_autostart()) {
RefPtr<IPropertyStore> pPropStore; RefPtr<IPropertyStore> pPropStore;
if (!FAILED(SHGetPropertyStoreForWindow(mWnd, IID_IPropertyStore, if (!FAILED(SHGetPropertyStoreForWindow(mWnd, IID_IPropertyStore,
getter_AddRefs(pPropStore)))) { getter_AddRefs(pPropStore)))) {