Bug 1901840 - restore browser.privateWindowSeparation.enabled pref r=nshukla,firefox-desktop-core-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D213651
This commit is contained in:
Eric Chen
2024-06-14 14:47:04 +00:00
parent e4163284d3
commit 35224d47a5
4 changed files with 17 additions and 2 deletions

View File

@@ -822,6 +822,10 @@ pref("browser.dataFeatureRecommendations.enabled", false);
// sets darkTheme data.
pref("browser.theme.dark-private-windows", true);
// Pref to control whether or not Private Browsing windows show up
// as separate icons in the Windows taskbar.
pref("browser.privateWindowSeparation.enabled", true);
// Controls visibility of the privacy segmentation preferences section.
pref("browser.privacySegmentation.preferences.show", false);

View File

@@ -322,7 +322,13 @@ function openBrowserWindow(
Ci.nsILoadContext
).usePrivateBrowsing = true;
if (AppConstants.platform == "win") {
if (
AppConstants.platform == "win" &&
Services.prefs.getBoolPref(
"browser.privateWindowSeparation.enabled",
true
)
) {
lazy.WinTaskbar.setGroupIdForWindow(
win,
lazy.WinTaskbar.defaultPrivateGroupId

View File

@@ -2756,6 +2756,10 @@ BrowserGlue.prototype = {
name: "ensurePrivateBrowsingShortcutExists",
condition:
AppConstants.platform == "win" &&
Services.prefs.getBoolPref(
"browser.privateWindowSeparation.enabled",
true
) &&
// We don't want a shortcut if it's been disabled, eg: by enterprise policy.
lazy.PrivateBrowsingUtils.enabled &&
// Private Browsing shortcuts for packaged builds come with the package,

View File

@@ -993,7 +993,8 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
}
}
if (aInitData->mIsPrivate) {
if (Preferences::GetBool("browser.privateWindowSeparation.enabled", true) &&
(aInitData->mIsPrivate)) {
// Although permanent Private Browsing mode is indeed Private Browsing,
// 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