diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index e6ec62ca234..0076ab5998e 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -6754,8 +6754,10 @@ let gPrivateBrowsingUI = { } } - if (gURLBar) { - // Disable switch to tab autocompletion for private windows + if (gURLBar && + !PrivateBrowsingUtils.permanentPrivateBrowsing) { + // Disable switch to tab autocompletion for private windows + // (not for "Always use private browsing" mode) gURLBar.setAttribute("autocompletesearchparam", ""); } } @@ -6778,9 +6780,10 @@ function switchToTabHavingURI(aURI, aOpenNew) { // This will switch to the tab in aWindow having aURI, if present. function switchIfURIInWindow(aWindow) { // Only switch to the tab if neither the source and desination window are - // private. - if (PrivateBrowsingUtils.isWindowPrivate(window) || - PrivateBrowsingUtils.isWindowPrivate(aWindow)) { + // private and they are not in permanent private borwsing mode + if ((PrivateBrowsingUtils.isWindowPrivate(window) || + PrivateBrowsingUtils.isWindowPrivate(aWindow)) && + !PrivateBrowsingUtils.permanentPrivateBrowsing) { return false; } diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 38b820ffaa2..7fa38691ed7 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -643,7 +643,8 @@ // Tabs in private windows aren't registered as "Open" so // that they don't appear as switch-to-tab candidates. if (!isBlankPageURL(aLocation.spec) && - !PrivateBrowsingUtils.isWindowPrivate(window)) { + (!PrivateBrowsingUtils.isWindowPrivate(window) || + PrivateBrowsingUtils.permanentPrivateBrowsing)) { autocomplete.registerOpenPage(aLocation); this.mBrowser.registeredOpenURI = aLocation; }