Bug 1901840 - restore browser.privateWindowSeparation.enabled pref a=pascalc

Original Revision: https://phabricator.services.mozilla.com/D213651

Differential Revision: https://phabricator.services.mozilla.com/D214715
This commit is contained in:
Eric Chen 2024-06-24 13:43:45 +00:00
parent ca9c82e93d
commit c3c9016393
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

@ -2743,6 +2743,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