From 2b827326642e7ef9ccd0c64fed1487b5df560984 Mon Sep 17 00:00:00 2001
From: Michael Kaply <345868+mkaply@users.noreply.github.com>
Date: Mon, 10 Feb 2020 14:24:33 -0600
Subject: [PATCH] Add Exceptions to tracking protection.

---
 README.md                     | 19 ++++++++++++++-----
 mac/org.mozilla.firefox.plist |  4 ++++
 windows/de-DE/firefox.adml    |  2 ++
 windows/en-US/firefox.adml    |  2 ++
 windows/es-ES/firefox.adml    |  2 ++
 windows/firefox.admx          |  1 +
 windows/fr-FR/firefox.adml    |  2 ++
 windows/it-IT/firefox.adml    |  2 ++
 windows/zh-TW/firefox.adml    |  2 ++
 9 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 7c80351..7d56b47 100644
--- a/README.md
+++ b/README.md
@@ -1325,7 +1325,9 @@ If `Cryptomining` is set to true, cryptomining scripts on websites are blocked.
 
 If `Fingerprinting` is set to true, fingerprinting scripts on websites are blocked.
 
-**Compatibility:** Firefox 60, Firefox ESR 60 (Cryptomining and Fingerprinting added in 70/68.2)\
+`Exceptions` are origins for which tracking protection is not enabled.
+
+**Compatibility:** Firefox 60, Firefox ESR 60 (Cryptomining and Fingerprinting added in 70/68.2, Exceptions added in 73/68.5)\
 **CCK2 Equivalent:** `dontCheckDefaultBrowser`\
 **Preferences Affected:** `privacy.trackingprotection.enabled`,`privacy.trackingprotection.pbmode.enabled`,`privacy.trackingprotection.cryptomining.enabled`,`privacy.trackingprotection.fingerprinting.enabled`
 
@@ -1335,6 +1337,8 @@ Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Value = 0x1 | 0x0
 Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Locked = 0x1 | 0x0
 Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Cryptomining = 0x1 | 0x0
 Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Fingerprinting = 0x1 | 0x0
+Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Exceptions\1= "https://example.com"
+
 ```
 #### macOS
 ```
@@ -1343,12 +1347,16 @@ Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Fingerprinting = 0x1
   <dict>
     <key>Value</key>
     <true/> | <false/>
-    <key><Locked/key>
+    <key><Locked</key>
     <true/> | <false/>
-    <key><Cryptomining/key>
+    <key><Cryptomining</key>
     <true/> | <false/>
-    <key><Fingerprinting/key>
+    <key><Fingerprinting</key>
     <true/> | <false/>
+    <key>Exceptions</key>
+    <array>
+      <string>https://example.com</string>
+    </array>
   </dict>
 </dict>
 ```
@@ -1360,7 +1368,8 @@ Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Fingerprinting = 0x1
       "Value": [true, false],
       "Locked": [true, false],
       "Cryptomining": [true, false],
-      "Fingerprinting": [true, false]
+      "Fingerprinting": [true, false],
+      "Exceptions": ["https://example.com"]
     }
 }
 ```
diff --git a/mac/org.mozilla.firefox.plist b/mac/org.mozilla.firefox.plist
index d9ddf5a..1d489be 100644
--- a/mac/org.mozilla.firefox.plist
+++ b/mac/org.mozilla.firefox.plist
@@ -180,6 +180,10 @@
 		<true/>
 		<key>Fingerprinting</key>
 		<true/>
+		<key>Exceptions</key>
+		<array>
+			<string>https://example.com</string>
+		</array>
 	</dict>
 	<key>Extensions</key>
 	<dict>
diff --git a/windows/de-DE/firefox.adml b/windows/de-DE/firefox.adml
index a426772..af2c857 100644
--- a/windows/de-DE/firefox.adml
+++ b/windows/de-DE/firefox.adml
@@ -700,6 +700,8 @@ https://github.com/mozilla/policy-templates/blob/master/README.md#preferences (E
         <checkBox refId="TrackingProtectionLocked">Änderungen am Schutz vor Aktivitäten Verfolgung nicht erlauben</checkBox>
         <checkBox refId="Cryptomining">Block cryptomining scripts.</checkBox>
         <checkBox refId="Fingerprinting">Block fingerprinting scripts.</checkBox>
+        <text>Exceptions:</text>
+        <listBox refId="TrackingProtection_Exceptions"/>
       </presentation>
       <presentation id="OverridePage">
         <textBox refId="OverridePage">
diff --git a/windows/en-US/firefox.adml b/windows/en-US/firefox.adml
index b418dec..09a6d3f 100644
--- a/windows/en-US/firefox.adml
+++ b/windows/en-US/firefox.adml
@@ -699,6 +699,8 @@ https://github.com/mozilla/policy-templates/blob/master/README.md#preferences.</
         <checkBox refId="TrackingProtectionLocked">Don't allow tracking protection preferences to be changed.</checkBox>
         <checkBox refId="Cryptomining">Block cryptomining scripts.</checkBox>
         <checkBox refId="Fingerprinting">Block fingerprinting scripts.</checkBox>
+        <text>Exceptions:</text>
+        <listBox refId="TrackingProtection_Exceptions"/>
       </presentation>
       <presentation id="OverridePage">
         <textBox refId="OverridePage">
diff --git a/windows/es-ES/firefox.adml b/windows/es-ES/firefox.adml
index 80697c9..f3ffe7e 100644
--- a/windows/es-ES/firefox.adml
+++ b/windows/es-ES/firefox.adml
@@ -699,6 +699,8 @@ https://github.com/mozilla/policy-templates/blob/master/README.md#preferences</s
         <checkBox refId="TrackingProtectionLocked">No permitir que se cambien las preferencias de protección contra rastreo.</checkBox>
         <checkBox refId="Cryptomining">Bloquear scripts de minado de criptomonedas.</checkBox>
         <checkBox refId="Fingerprinting">Bloquear scripts de huellas digitales.</checkBox>
+        <text>Exceptions:</text>
+        <listBox refId="TrackingProtection_Exceptions"/>
       </presentation>
       <presentation id="OverridePage">
         <textBox refId="OverridePage">
diff --git a/windows/firefox.admx b/windows/firefox.admx
index b80d902..fe8cc96 100644
--- a/windows/firefox.admx
+++ b/windows/firefox.admx
@@ -2388,6 +2388,7 @@
             <decimal value="0"/>
           </falseValue>
         </boolean>
+        <list id="TrackingProtection_Exceptions" key="Software\Policies\Mozilla\Firefox\EnableTrackingProtection\Exceptions" valuePrefix=""/>
       </elements>
     </policy>
     <!-- Alphabetization is based on name, so had to add B -->
diff --git a/windows/fr-FR/firefox.adml b/windows/fr-FR/firefox.adml
index 2c60929..6cce77f 100644
--- a/windows/fr-FR/firefox.adml
+++ b/windows/fr-FR/firefox.adml
@@ -699,6 +699,8 @@ https://github.com/mozilla/policy-templates/blob/master/README.md#preferences</s
         <checkBox refId="TrackingProtectionLocked">Ne pas autoriser la modification des préférences de protection du suivi.</checkBox>
         <checkBox refId="Cryptomining">Block cryptomining scripts.</checkBox>
         <checkBox refId="Fingerprinting">Block fingerprinting scripts.</checkBox>
+        <text>Exceptions:</text>
+        <listBox refId="TrackingProtection_Exceptions"/>
       </presentation>
       <presentation id="OverridePage">
         <textBox refId="OverridePage">
diff --git a/windows/it-IT/firefox.adml b/windows/it-IT/firefox.adml
index 07422c6..28d894d 100644
--- a/windows/it-IT/firefox.adml
+++ b/windows/it-IT/firefox.adml
@@ -699,6 +699,8 @@ https://github.com/mozilla/policy-templates/blob/master/README.md#preferences</s
         <checkBox refId="TrackingProtectionLocked">Non consentire la modifica delle preferenze relative alla protezione antitracciamento.</checkBox>
         <checkBox refId="Cryptomining">Blocca script cryptominer.</checkBox>
         <checkBox refId="Fingerprinting">Blocca script fingerprinter.</checkBox>
+        <text>Exceptions:</text>
+        <listBox refId="TrackingProtection_Exceptions"/>
       </presentation>
       <presentation id="OverridePage">
         <textBox refId="OverridePage">
diff --git a/windows/zh-TW/firefox.adml b/windows/zh-TW/firefox.adml
index 83e155c..4aca9e5 100644
--- a/windows/zh-TW/firefox.adml
+++ b/windows/zh-TW/firefox.adml
@@ -697,6 +697,8 @@ https://github.com/mozilla/policy-templates/blob/master/README.md#preferences。
         <checkBox refId="TrackingProtectionLocked">不允許調整追蹤保護偏好設定。</checkBox>
         <checkBox refId="Cryptomining">封鎖加密貨幣採礦程式。</checkBox>
         <checkBox refId="Fingerprinting">封鎖數位指紋追蹤程式。</checkBox>
+        <text>Exceptions:</text>
+        <listBox refId="TrackingProtection_Exceptions"/>
       </presentation>
       <presentation id="OverridePage">
         <textBox refId="OverridePage">
-- 
2.34.1