[tbb-commits] [tor-browser/tor-browser-68.1.0esr-9.0-2] fixup! Bug 24920 - Only create Private tabs if browser.privatebrowsing.autostart is true

gk at torproject.org gk at torproject.org
Wed Sep 25 12:50:50 UTC 2019


commit a07356ac7693bec4ed1b206bdbeb64287cb2a7f6
Author: Matthew Finkel <Matthew.Finkel at gmail.com>
Date:   Thu Sep 19 02:13:08 2019 +0000

    fixup! Bug 24920 - Only create Private tabs if browser.privatebrowsing.autostart is true
---
 mobile/android/chrome/content/browser.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js
index dbecd308a3dc..fc66e8b4f23e 100644
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4413,9 +4413,14 @@ Tab.prototype = {
     // Must be called after appendChild so the docShell has been created.
     this.setActive(false);
 
+    // Create a Private tab if it was explicitly requested or if the pref
+    // |browser.privatebrowsing.autostart| is true. If the pref is true, then all tabs are created
+    // as private tabs. The first clause covers new tabs requested by a user. The preference check
+    // is important because extensions directly open tabs (usually not private tabs) and bypass the
+    // private tab checks.
     let isPrivate = (("isPrivate" in aParams) && aParams.isPrivate) || Services.prefs.getBoolPref("browser.privatebrowsing.autostart");
     if (isPrivate) {
-      attrs['privateBrowsingId'] = 1;
+      attrs.privateBrowsingId = 1;
     }
 
     this.browser.docShell.setOriginAttributes(attrs);



More information about the tbb-commits mailing list