commit b917b2024bb71b2be832439df793ae5ec91d8082 Author: Georg Koppen gk@torproject.org Date: Fri Jun 16 11:36:06 2017 +0000
Bug 22560: Update privacy.thirdparty.isolate preference
In commit 2978978e64fbc9164185564a19d56d5fea0b25d8 we hinted at updating `privacy.thirdparty.isolate` once we switch to ESR 52. We forgot that while migrating but replace it now with `privacy.firstparty.isolate` as expected.
We remove `dom.workers.sharedWorkers.enabled` as this preference is long gone. --- src/chrome/content/torbutton.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js index 2d69b0c..ae705a3 100644 --- a/src/chrome/content/torbutton.js +++ b/src/chrome/content/torbutton.js @@ -86,7 +86,7 @@ var torbutton_unique_pref_observer = m_tb_prefs.addObserver("javascript", this, false); m_tb_prefs.addObserver("noscript", this, false); m_tb_prefs.addObserver("plugin.disable", this, false); - m_tb_prefs.addObserver("privacy.thirdparty.isolate", this, false); + m_tb_prefs.addObserver("privacy.firstparty.isolate", this, false); m_tb_prefs.addObserver("privacy.resistFingerprinting", this, false);
// We observe xpcom-category-entry-added for plugins w/ Gecko-Content-Viewers @@ -103,7 +103,7 @@ var torbutton_unique_pref_observer = m_tb_prefs.removeObserver("javascript", this); m_tb_prefs.removeObserver("noscript", this); m_tb_prefs.removeObserver("plugin.disable", this); - m_tb_prefs.removeObserver("privacy.thirdparty.isolate", this); + m_tb_prefs.removeObserver("privacy.firstparty.isolate", this); m_tb_prefs.removeObserver("privacy.resistFingerprinting", this);
var observerService = Cc["@mozilla.org/observer-service;1"]. @@ -151,12 +151,12 @@ var torbutton_unique_pref_observer = } switch (data) { case "network.cookie.cookieBehavior": - var val = m_tb_prefs.getIntPref("network.cookie.cookieBehavior"); - var block_thirdparty = m_tb_prefs.getIntPref("privacy.thirdparty.isolate") !== 0; - if (val == 0 && block_thirdparty) // Allow all cookies - m_tb_prefs.setIntPref("privacy.thirdparty.isolate", 0); - else if (val == 1 && !block_thirdparty) // Block third party cookies - m_tb_prefs.setIntPref("privacy.thirdparty.isolate", 2); + let val = m_tb_prefs.getIntPref("network.cookie.cookieBehavior"); + let firstparty_isolate = m_tb_prefs.getBoolPref("privacy.firstparty.isolate"); + if (val == 0 && firstparty_isolate) // Allow all cookies + m_tb_prefs.setBoolPref("privacy.firstparty.isolate", false); + else if (val == 1 && !firstparty_isolate) // Block third party cookies + m_tb_prefs.setBoolPref("privacy.firstparty.isolate", true); break;
case "plugin.disable": @@ -173,8 +173,8 @@ var torbutton_unique_pref_observer = case "extensions.torbutton.spoof_english": torbutton_update_fingerprinting_prefs(); break; - case "privacy.thirdparty.isolate": - torbutton_update_thirdparty_prefs(); + case "privacy.firstparty.isolate": + torbutton_update_isolation_prefs(); break; case "extensions.torbutton.hide_sync_ui": torbutton_update_sync_ui(); @@ -1743,8 +1743,8 @@ function torbutton_update_fingerprinting_prefs() { m_tb_prefs.savePrefFile(null); }
-function torbutton_update_thirdparty_prefs() { - let isolate = m_tb_prefs.getIntPref("privacy.thirdparty.isolate") !== 0; +function torbutton_update_isolation_prefs() { + let isolate = m_tb_prefs.getBoolPref("privacy.firstparty.isolate");
if (isolate) { m_tb_prefs.setIntPref("network.cookie.cookieBehavior", 1); @@ -1752,7 +1752,6 @@ function torbutton_update_thirdparty_prefs() { m_tb_prefs.setIntPref("network.cookie.cookieBehavior", 0); }
- m_tb_prefs.setBoolPref("dom.workers.sharedWorkers.enabled", !isolate); m_tb_prefs.setBoolPref("security.enable_tls_session_tickets", !isolate);
// Force prefs to be synced to disk