diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 27c2d13fbd85..21bbb6c8a99c 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -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); diff --git a/browser/components/BrowserContentHandler.sys.mjs b/browser/components/BrowserContentHandler.sys.mjs index 6c156d170069..1ac7a09d2d71 100644 --- a/browser/components/BrowserContentHandler.sys.mjs +++ b/browser/components/BrowserContentHandler.sys.mjs @@ -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 diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs index 81889db0409e..2f2aa0ac4904 100644 --- a/browser/components/BrowserGlue.sys.mjs +++ b/browser/components/BrowserGlue.sys.mjs @@ -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, diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index ac393e8b0932..b06a34c2f5cc 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -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