Commit 6d785fa1 authored by Arthur Edelstein's avatar Arthur Edelstein
Browse files

Bug 20244.1: Remove "block-disk" checkbox from Privacy & Security Settings

An equivalent checkbox, "Always use private browsing mode"
is already available in about:preferences#privacy. Better to leave
it more hidden from the user in any case, as it is inadvisable
to disable private browsing mode.

We remove the 'extensions.torbutton.block_disk' pref and use the
'browser.privatebrowsing.autostart' pref instead, because they
are equivalent.
parent 958d858f
......@@ -13,7 +13,6 @@ function torbutton_prefs_init(doc) {
var o_torprefs = torbutton_get_prefbranch('extensions.torbutton.');
// Privacy and security settings
doc.getElementById('torbutton_blockDisk').checked = o_torprefs.getBoolPref('block_disk');
doc.getElementById('torbutton_resistFingerprinting').checked = o_torprefs.getBoolPref('resist_fingerprinting');
doc.getElementById('torbutton_blockPlugins').checked = o_torprefs.getBoolPref('no_tor_plugins');
doc.getElementById('torbutton_restrictThirdParty').checked = o_torprefs.getBoolPref('restrict_thirdparty');
......@@ -46,20 +45,6 @@ function torbutton_prefs_save(doc) {
var o_torprefs = torbutton_get_prefbranch('extensions.torbutton.');
// Privacy and Security Settings
o_torprefs.setBoolPref('block_disk', doc.getElementById('torbutton_blockDisk').checked);
// If we have NoScript enabled we set `noscript.volatilePrivatePermissions`
// to `true` if we are blocking disk records and to `false` if we are
// enabling them.
try {
if ("@maone.net/noscript-service;1" in Components.classes) {
let o_noscriptprefs = torbutton_get_prefbranch('noscript.');
if (o_torprefs.getBoolPref('block_disk')) {
o_noscriptprefs.setBoolPref('volatilePrivatePermissions', true);
} else {
o_noscriptprefs.setBoolPref('volatilePrivatePermissions', false);
}
}
} catch (e) {}
o_torprefs.setBoolPref('resist_fingerprinting', doc.getElementById('torbutton_resistFingerprinting').checked);
o_torprefs.setBoolPref('no_tor_plugins', doc.getElementById('torbutton_blockPlugins').checked);
......@@ -184,45 +169,3 @@ function torbutton_set_slider_text(doc, custom) {
break;
}
}
function torbutton_prefs_check_disk() {
let o_torprefs = torbutton_get_prefbranch('extensions.torbutton.');
let old_mode = o_torprefs.getBoolPref('block_disk');
let mode = document.getElementById('torbutton_blockDisk').checked;
if (mode === old_mode) {
// Either revert, or uncheck.
return;
}
let sb = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService);
let bundle = sb.createBundle("chrome://browser/locale/preferences/preferences.properties");
let brandName = sb.createBundle("chrome://branding/locale/brand.properties").GetStringFromName("brandShortName");
let msg = bundle.formatStringFromName(mode ?
"featureEnableRequiresRestart" : "featureDisableRequiresRestart",
[brandName], 1);
let title = bundle.formatStringFromName("shouldRestartTitle", [brandName], 1);
let prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService);
let shouldProceed = prompts.confirm(window, title, msg)
if (shouldProceed) {
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
.createInstance(Ci.nsISupportsPRBool);
let obsSvc = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
obsSvc.notifyObservers(cancelQuit, "quit-application-requested",
"restart");
shouldProceed = !cancelQuit.data;
if (shouldProceed) {
document.documentElement.acceptDialog();
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"]
.getService(Ci.nsIAppStartup);
appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
return;
}
}
document.getElementById('torbutton_blockDisk').checked = old_mode;
}
......@@ -23,10 +23,6 @@
<groupbox>
<caption label="&torbutton.prefs.priv_caption;"
tooltiptext="&torbutton.prefs.priv_caption_tooltip;"/>
<checkbox id="torbutton_blockDisk"
label="&torbutton.prefs.block_disk;"
oncommand="torbutton_prefs_check_disk();"
tooltiptext="&torbutton.prefs.block_disk_tooltip;"/>
<checkbox id="torbutton_blockPlugins"
label="&torbutton.prefs.block_plugins;"
tooltiptext="&torbutton.prefs.block_plugins_tooltip;"/>
......
......@@ -153,12 +153,6 @@ var torbutton_unique_pref_observer =
if (topic != "nsPref:changed") return;
switch (data) {
case "browser.privatebrowsing.autostart":
var mode = m_tb_prefs.getBoolPref("browser.privatebrowsing.autostart");
var ourmode = m_tb_prefs.getBoolPref("extensions.torbutton.block_disk");
if (mode != ourmode)
m_tb_prefs.setBoolPref("extensions.torbutton.block_disk", mode);
break;
case "network.cookie.cookieBehavior":
var val = m_tb_prefs.getIntPref("network.cookie.cookieBehavior");
var block_thirdparty = m_tb_prefs.getBoolPref("extensions.torbutton.restrict_thirdparty");
......@@ -172,7 +166,7 @@ var torbutton_unique_pref_observer =
torbutton_toggle_plugins(
m_tb_prefs.getBoolPref("extensions.torbutton.no_tor_plugins"));
break;
case "extensions.torbutton.block_disk":
case "browser.privatebrowsing.autostart":
torbutton_update_disk_prefs();
break;
case "extensions.torbutton.use_nontor_proxy":
......@@ -392,7 +386,7 @@ function torbutton_init() {
// XXX: Get rid of the cached asmjs (or IndexedDB) files on disk in case we
// don't allow things saved to disk. This is an ad-hoc fix to work around
// #19417. Once this is properly solved we should remove this code again.
if (m_tb_prefs.getBoolPref("extensions.torbutton.block_disk")) {
if (m_tb_prefs.getBoolPref("browser.privatebrowsing.autostart")) {
let orig_quota_test = m_tb_prefs.getBoolPref("dom.quotaManager.testing");
try {
// This works only by setting the pref to `true` otherwise we get an
......@@ -1723,9 +1717,8 @@ function torbutton_toggle_plugins(disable_plugins) {
}
function torbutton_update_disk_prefs() {
var mode = m_tb_prefs.getBoolPref("extensions.torbutton.block_disk");
var mode = m_tb_prefs.getBoolPref("browser.privatebrowsing.autostart");
m_tb_prefs.setBoolPref("browser.privatebrowsing.autostart", mode);
m_tb_prefs.setBoolPref("browser.cache.disk.enable", !mode);
m_tb_prefs.setBoolPref("places.history.enabled", !mode);
......@@ -1747,6 +1740,15 @@ function torbutton_update_disk_prefs() {
m_tb_prefs.setIntPref("browser.download.manager.retention", 2);
}
// If we have NoScript enabled we set `noscript.volatilePrivatePermissions`
// to `true` if we are blocking disk records and to `false` if we are
// enabling them.
try {
if ("@maone.net/noscript-service;1" in Components.classes) {
m_tb_prefs.setBoolPref("volatilePrivatePermissions", mode);
}
} catch (e) {}
// Force prefs to be synced to disk
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
......@@ -2120,7 +2122,7 @@ function torbutton_check_protections()
// XXX: Bug 14632: The cookie dialog is useless in private browsing mode in FF31ESR
// See https://trac.torproject.org/projects/tor/ticket/10353 for more info.
document.getElementById("torbutton-cookie-protector").hidden = m_tb_prefs.getBoolPref("extensions.torbutton.block_disk");
document.getElementById("torbutton-cookie-protector").hidden = m_tb_prefs.getBoolPref("browser.privatebrowsing.autostart");
if (!m_tb_control_pass || (!m_tb_control_socket_file && !m_tb_control_port)) {
document.getElementById("torbutton-new-identity").disabled = true;
......
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -25,7 +25,6 @@
<!ENTITY torbutton.cookiedialog.saveAllCookies "احم ملفات تعريف الارتباط الجديدة">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "لا تحم ملفات تعريف الارتباط الجديدة">
<!ENTITY torbutton.prefs.priv_caption "إعدادات الخصوصية">
<!ENTITY torbutton.prefs.block_disk "لا تسجل سجل التصفح أو بيانات المواقع الألكترونية (تفعيل التصفح الخصوصي)">
<!ENTITY torbutton.prefs.restrict_thirdparty "تقييد الـCookies الخاصة بالطرف الثالث و بيانات التتبع الأخري.">
<!ENTITY torbutton.prefs.block_plugins "تعطيل إضافات المتصفح (مثل فلاش)">
<!ENTITY torbutton.prefs.resist_fingerprinting "تغيير التفاصيل التي تميزك عن المستخدمين الآخرين لمتصفح تور">
......@@ -58,4 +57,3 @@
<!ENTITY torbutton.prefs.sec_webfonts_desc_tooltip "Website-provided font files are blocked.">
<!ENTITY torbutton.prefs.sec_custom "قيم مخصصة">
<!ENTITY torbutton.circuit_display.title "دائرة تور لهذا الموقع">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
......@@ -21,7 +21,6 @@
<!ENTITY torbutton.cookiedialog.removeAllBut "Remove All But Protected">
<!ENTITY torbutton.cookiedialog.saveAllCookies "Protect New Cookies">
<!ENTITY torbutton.cookiedialog.doNotSaveAllCookies "Do Not Protect New Cookies">
<!ENTITY torbutton.prefs.block_disk "Don't record browsing history or website data (enables Private Browsing Mode)">
<!ENTITY torbutton.prefs.restrict_thirdparty "Restrict third party cookies and other tracking data">
<!ENTITY torbutton.prefs.block_plugins "Disable browser plugins (such as Flash)">
<!ENTITY torbutton.prefs.resist_fingerprinting "Change details that distinguish you from other Tor Browser users">
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