Commit 2978978e authored by Arthur Edelstein's avatar Arthur Edelstein
Browse files

Bug 20244.3: Remove 'restrict third party cookies...' checkbox

Also, we remove the 'extensions.torbutton.restrict_thirdparty'
and use the 'privacy.thirdparty.isolate' pref. At the same time we
will need to add a checkbox to the about:preferences#privacy page
that toggles 'privacy.thirdparty.isolate'.

Note that 'privacy.thirdparty.isolate' will be renamed to
'privacy.firstparty.isolate' in Firefox 52.
parent aa05941e
......@@ -14,7 +14,6 @@ function torbutton_prefs_init(doc) {
// Privacy and security settings
doc.getElementById('torbutton_resistFingerprinting').checked = o_torprefs.getBoolPref('resist_fingerprinting');
doc.getElementById('torbutton_restrictThirdParty').checked = o_torprefs.getBoolPref('restrict_thirdparty');
let sec_slider = doc.getElementById('torbutton_sec_slider');
let sec_custom = doc.getElementById('torbutton_sec_custom');
let custom_values = o_torprefs.getBoolPref('security_custom');
......@@ -46,7 +45,6 @@ function torbutton_prefs_save(doc) {
// Privacy and Security Settings
o_torprefs.setBoolPref('resist_fingerprinting', doc.getElementById('torbutton_resistFingerprinting').checked);
o_torprefs.setBoolPref('restrict_thirdparty', doc.getElementById('torbutton_restrictThirdParty').checked);
o_torprefs.setBoolPref('security_custom',
doc.getElementById('torbutton_sec_custom').checked);
o_torprefs.setIntPref('security_slider',
......
......@@ -23,9 +23,6 @@
<groupbox>
<caption label="&torbutton.prefs.priv_caption;"
tooltiptext="&torbutton.prefs.priv_caption_tooltip;"/>
<checkbox id="torbutton_restrictThirdParty"
label="&torbutton.prefs.restrict_thirdparty;"
tooltiptext="&torbutton.prefs.restrict_thirdparty_tooltip;"/>
<checkbox id="torbutton_resistFingerprinting"
label="&torbutton.prefs.resist_fingerprinting;"
tooltiptext="&torbutton.prefs.resist_fingerprinting_tooltip;"/>
......
......@@ -96,6 +96,7 @@ var torbutton_unique_pref_observer =
this._branch.addObserver("mathml", this, false);
this._branch.addObserver("svg", this, false);
this._branch.addObserver("plugin.disable", this, false);
this._branch.addObserver("privacy.thirdparty.isolate", this, false);
// We observe xpcom-category-entry-added for plugins w/ Gecko-Content-Viewers
var observerService = Cc["@mozilla.org/observer-service;1"].
......@@ -156,11 +157,11 @@ 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.getBoolPref("extensions.torbutton.restrict_thirdparty");
var block_thirdparty = m_tb_prefs.getIntPref("privacy.thirdparty.isolate") !== 0;
if (val == 0 && block_thirdparty) // Allow all cookies
m_tb_prefs.setBoolPref("extensions.torbutton.restrict_thirdparty", false);
m_tb_prefs.setIntPref("privacy.thirdparty.isolate", 0);
else if (val == 1 && !block_thirdparty) // Block third party cookies
m_tb_prefs.setBoolPref("extensions.torbutton.restrict_thirdparty", true);
m_tb_prefs.setIntPref("privacy.thirdparty.isolate", 2);
break;
case "plugin.disable":
......@@ -177,7 +178,7 @@ var torbutton_unique_pref_observer =
case "extensions.torbutton.spoof_english":
torbutton_update_fingerprinting_prefs();
break;
case "extensions.torbutton.restrict_thirdparty":
case "privacy.thirdparty.isolate":
torbutton_update_thirdparty_prefs();
break;
case "extensions.torbutton.hide_sync_ui":
......@@ -1803,24 +1804,16 @@ function torbutton_update_fingerprinting_prefs() {
}
function torbutton_update_thirdparty_prefs() {
var mode = m_tb_prefs.getBoolPref("extensions.torbutton.restrict_thirdparty");
let isolate = m_tb_prefs.getIntPref("privacy.thirdparty.isolate") !== 0;
try {
if (mode) {
m_tb_prefs.setIntPref("privacy.thirdparty.isolate", 2);
} else {
m_tb_prefs.setIntPref("privacy.thirdparty.isolate", 0);
}
} catch(e) {}
if (mode) {
if (isolate) {
m_tb_prefs.setIntPref("network.cookie.cookieBehavior", 1);
} else {
m_tb_prefs.setIntPref("network.cookie.cookieBehavior", 0);
}
m_tb_prefs.setBoolPref("dom.workers.sharedWorkers.enabled", !mode);
m_tb_prefs.setBoolPref("security.enable_tls_session_tickets", !mode);
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
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
......
......@@ -45,7 +45,6 @@ pref("extensions.torbutton.launch_warning",true);
pref("extensions.torbutton@torproject.org.getAddons.cache.enabled", false);
pref("extensions.torbutton.resist_fingerprinting", true);
pref("extensions.torbutton.restrict_thirdparty", true);
// Security Slider
pref("extensions.torbutton.security_slider", 4);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment