[tbb-commits] [tor-browser/tor-browser-45.4.0esr-6.5-1] Bug 20244.2: Add "privacy.thirdparty.isolate" checkbox

gk at torproject.org gk at torproject.org
Mon Oct 17 06:58:11 UTC 2016


commit e5c3cd25ed459765a91d1b364151c46afaca36c0
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date:   Thu Oct 6 21:09:43 2016 +0000

    Bug 20244.2: Add "privacy.thirdparty.isolate" checkbox
---
 .../components/preferences/in-content/privacy.js   | 33 ++++++++++++++++++++++
 .../components/preferences/in-content/privacy.xul  | 13 +++++++++
 .../en-US/chrome/browser/preferences/privacy.dtd   |  2 ++
 3 files changed, 48 insertions(+)

diff --git a/browser/components/preferences/in-content/privacy.js b/browser/components/preferences/in-content/privacy.js
index 3ec0afe..69f9156 100644
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -299,6 +299,39 @@ var gPrivacyPane = {
     }
   },
 
+  // THIRD PARTY ISOLATION
+
+  /**
+   * Converts from privacy.thirdparty.isolate pref to boolean checkbox.
+   * Note that during uplift, Mozilla changed the name to
+   * privacy.firstparty.isolate, and also changed it to a boolean,
+   * so this function is likely not needed after uplifting.
+   */
+  readThirdPartyIsolate: function ()
+  {
+    var pref = document.getElementById("privacy.thirdparty.isolate");
+    switch (pref.value)
+    {
+      case 0: // Off
+        return false;
+      case 1: // PBM only
+        return true;
+      case 2: // Always
+        return true;
+      default:
+        return undefined;
+    }
+  },
+
+  /**
+   * Convert from checkbox to private.thirdparty.isolate pref.
+   */
+  writeThirdPartyIsolate: function ()
+  {
+    var checkbox = document.getElementById("thirdpartyIsolateCB");
+    return checkbox.checked ? 2 : 0;
+  },
+
   // PRIVATE BROWSING
 
   /**
diff --git a/browser/components/preferences/in-content/privacy.xul b/browser/components/preferences/in-content/privacy.xul
index bdadcc5..d180ee2 100644
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -19,6 +19,9 @@
   <preference id="privacy.trackingprotection.pbmode.enabled"
               name="privacy.trackingprotection.pbmode.enabled"
               type="bool"/>
+  <preference id="privacy.thirdparty.isolate"
+              name="privacy.thirdparty.isolate"
+              type="int"/>
   <preference id="privacy.resistFingerprinting"
               name="privacy.resistFingerprinting"
               type="bool"/>
@@ -130,6 +133,16 @@
               preference="pref.privacy.disable_button.change_blocklist"/>
     </hbox>
   </vbox>
+  <vbox id="thirdpartyIsolate">
+    <hbox align="center">
+      <checkbox id="thirdpartyIsolateCB"
+                preference="privacy.thirdparty.isolate"
+                accesskey="&thirdpartyIsolate.accesskey;"
+                label="&thirdpartyIsolate.label;"
+                onsyncfrompreference="return gPrivacyPane.readThirdPartyIsolate();"
+                onsynctopreference="return gPrivacyPane.writeThirdPartyIsolate();"/>
+    </hbox>
+  </vbox>
   <vbox id="resistFingerprinting">
     <hbox align="center">
       <checkbox id="resistFingerprintingCB"
diff --git a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
index ce3330e..614200e 100644
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -13,6 +13,8 @@
 <!ENTITY trackingProtectionPBM5.label         "Use Tracking Protection in Private Windows">
 <!ENTITY trackingProtectionPBM5.accesskey     "v">
 <!ENTITY trackingProtectionPBMLearnMore.label "Learn more">
+<!ENTITY thirdpartyIsolate.label "Restrict third party cookies and other tracking data">
+<!ENTITY thirdpartyIsolate.accesskey "R">
 <!ENTITY resistFingerprinting.label "Change details that distinguish you from other Tor Browser users">
 <!ENTITY resistFingerprinting.accesskey "F">
 <!ENTITY changeBlockList.label          "Change Block List">



More information about the tbb-commits mailing list