commit 4eaf9a7b5ef5156c7b64d9cdf5216f7d46a55e17 Author: Mike Perry mikeperry-git@fscked.org Date: Thu Jun 23 17:59:58 2011 -0700
Bug 3441: Enable cookie protection UI by default.
Also handle the upgrade case to avoid inconsistent prefs. --- src/chrome/content/torbutton.js | 14 +++++++++++++- src/defaults/preferences/preferences.js | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js index d62549a..2a5d8ca 100644 --- a/src/chrome/content/torbutton.js +++ b/src/chrome/content/torbutton.js @@ -3466,7 +3466,19 @@ function torbutton_do_startup() // in torbutton_do_main_window_startup to avoid // popup notification. torbutton_do_fresh_install(); - + + // The cookie protections pref was added recently, and we would like + // it to be the new default. We must update the older prefs to match + // if it is set, to handle upgrade inconsistencies. + // + // We do this before the pref observers get registered to avoid + // popups and non-tor policy changes. + if (m_tb_prefs.getBoolPref('extensions.torbutton.cookie_protections')) { + m_tb_prefs.setBoolPref('extensions.torbutton.cookie_jars', false); + m_tb_prefs.setBoolPref('extensions.torbutton.dual_cookie_jars', true); + m_tb_prefs.setBoolPref('extensions.torbutton.clear_cookies', false); + } + torbutton_do_main_window_startup();
// This is due to Bug 908: UserAgent Switcher is resetting diff --git a/src/defaults/preferences/preferences.js b/src/defaults/preferences/preferences.js index fd88a1e..10538e0 100644 --- a/src/defaults/preferences/preferences.js +++ b/src/defaults/preferences/preferences.js @@ -115,10 +115,10 @@ pref("extensions.torbutton.prompted_language",false); // Security prefs: pref("extensions.torbutton.no_tor_plugins",true); pref("extensions.torbutton.clear_cookies",false); -pref("extensions.torbutton.cookie_jars",true); -pref("extensions.torbutton.cookie_protections",false); +pref("extensions.torbutton.cookie_jars",false); +pref("extensions.torbutton.cookie_protections",true); pref("extensions.torbutton.cookie_auto_protect",false); -pref("extensions.torbutton.dual_cookie_jars",false); +pref("extensions.torbutton.dual_cookie_jars",true); pref("extensions.torbutton.disable_domstorage",true); pref("extensions.torbutton.clear_cache",true); pref("extensions.torbutton.block_cache",false);
tor-commits@lists.torproject.org