Commit 35970c68 authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 9387: Version 0.8 of the Security Slider

This is the first version of the slider that contains explanatory
strings to make it more clear to the user what is changed and why.

Special thanks to Mike Perry for helping out getting this part of the
UI in good shape.
parent 54d02f3c
......@@ -192,13 +192,18 @@ function torbutton_prefs_init(doc) {
sec_slider.value = o_torprefs.getIntPref('security_slider');
sec_custom.checked = custom_values;
sec_custom.disabled = !custom_values;
torbutton_set_slider_text(doc, sec_custom.checked);
// If the custom checkbox is checked and the user is done with dragging
// uncheck the checkbox to allow setting the (newly) chosen security level.
sec_slider.dragStateChanged = function(isDragging) {
if (!isDragging && sec_custom.checked) {
sec_custom.checked = false;
sec_custom.disabled = true;
}
}
sec_slider.valueChanged = function(which, newValue, userChanged) {
torbutton_set_slider_text(doc, false);
}
torbutton_prefs_set_field_attributes(doc);
}
......@@ -473,6 +478,49 @@ function torbutton_toggle_slider(doc, pos) {
if (sec_custom.checked) {
sec_custom.checked = false;
}
torbutton_set_slider_text(doc, false);
}
function torbutton_set_slider_text(doc, custom) {
let level = doc.getElementById("torbutton_sec_slider").value;
if (custom) {
level = 5;
}
switch (level) {
case (1):
doc.getElementById("desc_low").collapsed = true;
doc.getElementById("desc_medium_low").collapsed = true;
doc.getElementById("desc_medium_high").collapsed = true;
doc.getElementById("desc_high").collapsed = false;
break;
case (2):
doc.getElementById("desc_low").collapsed = true;
doc.getElementById("desc_medium_low").collapsed = true;
doc.getElementById("desc_medium_high").collapsed = false;
doc.getElementById("desc_high").collapsed = true;
break;
case (3):
doc.getElementById("desc_low").collapsed = true;
doc.getElementById("desc_medium_low").collapsed = false;
doc.getElementById("desc_medium_high").collapsed = true;
doc.getElementById("desc_high").collapsed = true;
break;
case (4):
doc.getElementById("desc_low").collapsed = false;
doc.getElementById("desc_medium_low").collapsed = true;
doc.getElementById("desc_medium_high").collapsed = true;
doc.getElementById("desc_high").collapsed = true;
break;
case (5):
doc.getElementById("desc_low").collapsed = true;
doc.getElementById("desc_medium_low").collapsed = true;
doc.getElementById("desc_medium_high").collapsed = true;
doc.getElementById("desc_high").collapsed = true;
break;
}
// It can happen that the descriptions of the slider settings consume more
// space than originally allocated. Adapt the dialog size accordingly.
sizeToContent();
}
function torbutton_prefs_check_disk() {
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://torbutton/skin/preferences.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://torbutton/locale/torbutton.dtd">
......@@ -156,36 +157,144 @@
<groupbox>
<caption label="&torbutton.prefs.sec_caption;"/>
<hbox>
<vbox>
<scale id="torbutton_sec_slider" height="200" min="1" max="4"
<vbox height="200">
<scale id="torbutton_sec_slider" flex="1" min="1" max="4"
movetoclick="true" orient="vertical"/>
</vbox>
<vbox height="200">
<hbox flex="1" align="center">
<description id="torbutton_sec_low"
<hbox flex="1" align="start">
<description id="torbutton_sec_high"
tooltip="high_preview"
onclick="torbutton_toggle_slider(document, 1);">
&torbutton.prefs.sec_low;
&torbutton.prefs.sec_high;
</description>
</hbox>
<hbox flex="1" align="center">
<description id="torbutton_sec_med_low"
<description id="torbutton_sec_med_high"
tooltip="mh_preview"
onclick="torbutton_toggle_slider(document, 2);">
&torbutton.prefs.sec_med_low;
&torbutton.prefs.sec_med_high;
</description>
</hbox>
<hbox flex="1" align="center">
<description id="torbutton_sec_med_high"
<description id="torbutton_sec_med_low"
tooltip="ml_preview"
onclick="torbutton_toggle_slider(document, 3);">
&torbutton.prefs.sec_med_high;
&torbutton.prefs.sec_med_low;
</description>
</hbox>
<hbox flex="1" align="center">
<description id="torbutton_sec_high"
<hbox flex="1" align="end">
<description id="torbutton_sec_low"
tooltip="low_preview"
onclick="torbutton_toggle_slider(document, 4);">
&torbutton.prefs.sec_high;
&torbutton.prefs.sec_low;
</description>
</hbox>
</vbox>
<spacer flex="1"/>
<!-- A width of 400 is already too much for OS X it seems. The above
spacer tag would basically be useless and the layout ugly. -->
<vbox flex="1" width="300">
<vbox id="desc_high" collapsed="true">
<description
class="slider-text-size, slider-text-weight">
&torbutton.prefs.sec_gen_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_html5_tooltip;">
&torbutton.prefs.sec_html5_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_jit_desc_tooltip; &torbutton.prefs.sec_baseline_jit_desc_tooltip;">
&torbutton.prefs.sec_all_jit_desc; &torbutton.prefs.sec_jit_slower_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_jar_tooltip;">
&torbutton.prefs.sec_jar_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_mathml_desc_tooltip;">
&torbutton.prefs.sec_mathml_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_font_rend_svg_tooltip; &torbutton.prefs.sec_font_rend_graphite_tooltip;">
&torbutton.prefs.sec_font_rend_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_js_desc_tooltip;">
&torbutton.prefs.sec_all_js_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_svg_desc_tooltip;">
&torbutton.prefs.sec_svg_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_webfonts_desc_tooltip;">
&torbutton.prefs.sec_webfonts_desc;
</description>
</vbox>
<vbox id="desc_medium_high" collapsed="true">
<description
class="slider-text-size, slider-text-weight">
&torbutton.prefs.sec_gen_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_html5_tooltip;">
&torbutton.prefs.sec_html5_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_jit_desc_tooltip; &torbutton.prefs.sec_baseline_jit_desc_tooltip;">
&torbutton.prefs.sec_all_jit_desc; &torbutton.prefs.sec_jit_slower_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_jar_tooltip;">
&torbutton.prefs.sec_jar_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_mathml_desc_tooltip;">
&torbutton.prefs.sec_mathml_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_font_rend_svg_tooltip; &torbutton.prefs.sec_font_rend_graphite_tooltip;">
&torbutton.prefs.sec_font_rend_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_js_desc_tooltip;">
&torbutton.prefs.sec_js_https_desc;
</description>
</vbox>
<vbox id="desc_medium_low" collapsed="true">
<description
class="slider-text-size, slider-text-weight">
&torbutton.prefs.sec_gen_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_html5_tooltip;">
&torbutton.prefs.sec_html5_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_jit_desc_tooltip;">
&torbutton.prefs.sec_some_jit_desc; &torbutton.prefs.sec_jit_slower_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_jar_tooltip;">
&torbutton.prefs.sec_jar_desc;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_mathml_desc_tooltip;">
&torbutton.prefs.sec_mathml_desc;
</description>
</vbox>
<vbox id="desc_low" collapsed="false">
<description
class="slider-text-size, slider-text-weight">
&torbutton.prefs.sec_low_desc;
</description>
<description class="slider-text-size">
&torbutton.prefs.sec_low_usable_desc;
</description>
</vbox>
</vbox>
</hbox>
<hbox>
<checkbox id="torbutton_sec_custom" flex="1"
......@@ -198,4 +307,43 @@
</tabpanels>
</tabbox>
<tooltip id="high_preview">
<html:b>&torbutton.prefs.sec_gen_desc;</html:b>
<html:br></html:br>
<html:br></html:br>
<html:div>&torbutton.prefs.sec_html5_desc;</html:div>
<html:div>&torbutton.prefs.sec_some_jit_desc;</html:div>
<html:div>&torbutton.prefs.sec_jar_desc;</html:div>
<html:div>&torbutton.prefs.sec_mathml_desc;</html:div>
<html:div>&torbutton.prefs.sec_font_rend_desc;</html:div>
<html:div>&torbutton.prefs.sec_all_js_desc;</html:div>
<html:div>&torbutton.prefs.sec_svg_desc;</html:div>
<html:div>&torbutton.prefs.sec_webfonts_desc;</html:div>
</tooltip>
<tooltip id="mh_preview">
<html:b>&torbutton.prefs.sec_gen_desc;</html:b>
<html:br></html:br>
<html:br></html:br>
<html:div>&torbutton.prefs.sec_html5_desc;</html:div>
<html:div>&torbutton.prefs.sec_some_jit_desc;</html:div>
<html:div>&torbutton.prefs.sec_jar_desc;</html:div>
<html:div>&torbutton.prefs.sec_mathml_desc;</html:div>
<html:div>&torbutton.prefs.sec_font_rend_desc;</html:div>
<html:div>&torbutton.prefs.sec_js_https_desc;</html:div>
</tooltip>
<tooltip id="ml_preview">
<html:b>&torbutton.prefs.sec_gen_desc;</html:b>
<html:br></html:br>
<html:br></html:br>
<html:div>&torbutton.prefs.sec_html5_desc;</html:div>
<html:div>&torbutton.prefs.sec_some_jit_desc;</html:div>
<html:div>&torbutton.prefs.sec_jar_desc;</html:div>
<html:div>&torbutton.prefs.sec_mathml_desc;</html:div>
</tooltip>
<tooltip id="low_preview">
<html:b>&torbutton.prefs.sec_low_desc;</html:b>
<html:br></html:br>
<html:br></html:br>
<html:div>&torbutton.prefs.sec_low_usable_desc;</html:div>
</tooltip>
</dialog>
......@@ -235,15 +235,12 @@ var torbutton_unique_pref_observer =
case "noscript.forbidMedia":
case "media.webaudio.enabled":
case "network.jar.block-remote-files":
case "mathml.disabled":
case "javascript.options.baselinejit.content":
case "noscript.forbidFonts":
case "gfx.font_rendering.graphite.enabled":
case "noscript.globalHttpsWhitelist":
case "noscript.global":
case "media.ogg.enabled":
case "media.opus.enabled":
case "media.wave.enabled":
case "media.apple.mp3.enabled":
// |m_tb_slider_update| is only set if the user updated a
// preference under control of the security slider via the
// slider on the Torbutton dialog. This in turn means we can
......@@ -2197,10 +2194,6 @@ function torbutton_update_thirdparty_prefs() {
prefService.savePrefFile(null);
}
var torbutton_sec_l_bool_prefs = {
"gfx.font_rendering.opentype_svg.enabled" : false,
};
var torbutton_sec_ml_bool_prefs = {
"javascript.options.ion.content" : false,
"javascript.options.typeinference" : false,
......@@ -2208,23 +2201,21 @@ var torbutton_sec_ml_bool_prefs = {
"noscript.forbidMedia" : true,
"media.webaudio.enabled" : false,
"network.jar.block-remote-files" : true,
// XXX: pref for disabling MathML is missing
"mathml.disabled" : true
};
var torbutton_sec_mh_bool_prefs = {
"javascript.options.baselinejit.content" : false,
"gfx.font_rendering.graphite.enabled" : false,
"gfx.font_rendering.opentype_svg.enabled" : false,
"noscript.global" : false,
"noscript.globalHttpsWhitelist" : true,
// XXX: pref for disableing SVG is missing
"noscript.globalHttpsWhitelist" : true
};
var torbutton_sec_h_bool_prefs = {
"noscript.forbidFonts" : true,
"noscript.global" : false,
"media.ogg.enabled" : false,
"media.opus.enabled" : false,
"media.wave.enabled" : false,
"media.apple.mp3.enabled" : false
// XXX: pref for disabling SVG is missing
};
function torbutton_update_security_slider() {
......@@ -2233,18 +2224,20 @@ function torbutton_update_security_slider() {
let mode = m_tb_prefs.getIntPref("extensions.torbutton.security_slider");
let capValue = m_tb_prefs.getCharPref("capability.policy.maonoscript.sites");
switch (mode) {
case 1:
for (p in torbutton_sec_l_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_l_bool_prefs[p]);
}
case 1:
for (p in torbutton_sec_ml_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_ml_bool_prefs[p])
m_tb_prefs.setBoolPref(p, torbutton_sec_ml_bool_prefs[p])
}
for (p in torbutton_sec_mh_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_mh_bool_prefs[p])
m_tb_prefs.setBoolPref(p, torbutton_sec_mh_bool_prefs[p])
// noscript.globalHttpsWhitelist is special: We don't want it in this
// mode.
if (p === "noscript.globalHttpsWhitelist") {
m_tb_prefs.setBoolPref(p, !torbutton_sec_mh_bool_prefs[p])
}
}
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_h_bool_prefs[p])
m_tb_prefs.setBoolPref(p, torbutton_sec_h_bool_prefs[p])
}
// Removing "https:" is needed due to a bug in older Noscript versions.
// We leave that in for a while as there may be users that were affected
......@@ -2254,18 +2247,22 @@ function torbutton_update_security_slider() {
m_tb_prefs.setCharPref("capability.policy.maonoscript.sites",
capValue.replace(" https:", ""));
}
if (m_tb_prefs.getCharPref("general.useragent.locale") !== "ko" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "vi" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "zh-CN") {
m_tb_prefs.setBoolPref("gfx.font_rendering.graphite.enabled", false);
} else {
m_tb_prefs.setBoolPref("gfx.font_rendering.graphite.enabled", true);
}
break;
case 2:
for (p in torbutton_sec_l_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_l_bool_prefs[p]);
for (p in torbutton_sec_ml_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_ml_bool_prefs[p])
}
// Order matters here as both the high mode and the medium-high mode
// share some preferences/values. So, let's revert the high mode
// preferences first and set the medium-high mode ones afterwards.
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_h_bool_prefs[p])
}
for (p in torbutton_sec_mh_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_mh_bool_prefs[p])
}
break;
case 3:
for (p in torbutton_sec_ml_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_ml_bool_prefs[p])
}
......@@ -2283,49 +2280,16 @@ function torbutton_update_security_slider() {
m_tb_prefs.setCharPref("capability.policy.maonoscript.sites",
capValue.replace(" https:", ""));
}
if (m_tb_prefs.getCharPref("general.useragent.locale") !== "ko" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "vi" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "zh-CN") {
m_tb_prefs.setBoolPref("gfx.font_rendering.graphite.enabled", false);
} else {
m_tb_prefs.setBoolPref("gfx.font_rendering.graphite.enabled", true);
}
break;
case 3:
for (p in torbutton_sec_l_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_l_bool_prefs[p]);
}
for (p in torbutton_sec_ml_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_ml_bool_prefs[p])
}
// Order matters here as both the high mode and the medium-high mode
// share some preferences/values. So, let's revert the high mode
// preferences first and set the medium-high mode ones afterwards.
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_h_bool_prefs[p])
}
for (p in torbutton_sec_mh_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_mh_bool_prefs[p])
}
m_tb_prefs.setBoolPref("gfx.font_rendering.graphite.enabled", false);
break;
case 4:
for (p in torbutton_sec_l_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_l_bool_prefs[p]);
}
for (p in torbutton_sec_ml_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_ml_bool_prefs[p])
m_tb_prefs.setBoolPref(p, !torbutton_sec_ml_bool_prefs[p])
}
for (p in torbutton_sec_mh_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_mh_bool_prefs[p])
// noscript.globalHttpsWhitelist is special: We don't want it in this
// mode.
if (p === "noscript.globalHttpsWhitelist") {
m_tb_prefs.setBoolPref(p, !torbutton_sec_mh_bool_prefs[p])
}
m_tb_prefs.setBoolPref(p, !torbutton_sec_mh_bool_prefs[p])
}
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_h_bool_prefs[p])
m_tb_prefs.setBoolPref(p, !torbutton_sec_h_bool_prefs[p])
}
// Removing "https:" is needed due to a bug in older Noscript versions.
// We leave that in for a while as there may be users that were affected
......@@ -2335,7 +2299,6 @@ function torbutton_update_security_slider() {
m_tb_prefs.setCharPref("capability.policy.maonoscript.sites",
capValue.replace(" https:", ""));
}
m_tb_prefs.setBoolPref("gfx.font_rendering.graphite.enabled", true);
break;
}
m_tb_sliderUpdate = false;
......@@ -2348,35 +2311,23 @@ function torbutton_security_slider_custom_check(mode) {
let capValue = m_tb_prefs.getCharPref("capability.policy.maonoscript.sites");
switch (mode) {
case 1:
for (p in torbutton_sec_l_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_l_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_ml_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_ml_bool_prefs[p]) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_ml_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_mh_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_mh_bool_prefs[p]) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_mh_bool_prefs[p]) {
// We don't want to have the whitelist in high mode. JavaScript is
// disabled globally.
if (p === "noscript.globalHttpsWhitelist") {
continue;
}
return;
}
}
for (p in torbutton_sec_h_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_h_bool_prefs[p]) {
return;
}
}
if (m_tb_prefs.getCharPref("general.useragent.locale") !== "ko" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "vi" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "zh-CN") {
if (m_tb_prefs.getBoolPref("gfx.font_rendering.graphite.enabled")) {
return;
}
} else {
if (!m_tb_prefs.getBoolPref("gfx.font_rendering.graphite.enabled")) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_h_bool_prefs[p]) {
return;
}
}
......@@ -2385,35 +2336,23 @@ function torbutton_security_slider_custom_check(mode) {
m_tb_prefs.setBoolPref("extensions.torbutton.security_custom", false);
break;
case 2:
for (p in torbutton_sec_l_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_l_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_ml_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_ml_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_mh_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_mh_bool_prefs[p]) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_mh_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_h_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_h_bool_prefs[p]) {
return;
}
}
if (m_tb_prefs.getCharPref("general.useragent.locale") !== "ko" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "vi" ||
m_tb_prefs.getCharPref("general.useragent.locale") !== "zh-CN") {
if (m_tb_prefs.getBoolPref("gfx.font_rendering.graphite.enabled")) {
return;
}
} else {
if (!m_tb_prefs.getBoolPref("gfx.font_rendering.graphite.enabled")) {
// We have the whitelist and JavaScript is disabled in medium-high
// mode as well.
if (p === "noscript.global") {
continue;
}
return;
}
}
......@@ -2422,67 +2361,41 @@ function torbutton_security_slider_custom_check(mode) {
m_tb_prefs.setBoolPref("extensions.torbutton.security_custom", false);
break;
case 3:
for (p in torbutton_sec_l_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_l_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_ml_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_ml_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_mh_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_mh_bool_prefs[p]) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_mh_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_h_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_h_bool_prefs[p]) {
// We have the whitelist and JavaScript is disabled in medium-high
// mode as well.
if (p === "noscript.global") {
continue;
}
return;
}
}
if (m_tb_prefs.getBoolPref("gfx.font_rendering.graphite.enabled")) {
return;
}
// We are still here which means all preferences are properly reset. Leave
// custom mode.
m_tb_prefs.setBoolPref("extensions.torbutton.security_custom", false);
break;
case 4:
for (p in torbutton_sec_l_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_l_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_ml_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_ml_bool_prefs[p]) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_ml_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_mh_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_mh_bool_prefs[p]) {
// We don't want to have the whitelist in high mode. JavaScript is
// disabled globally.
if (p === "noscript.globalHttpsWhitelist") {
continue;
}
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_mh_bool_prefs[p]) {
return;
}
}
for (p in torbutton_sec_h_bool_prefs) {
if (m_tb_prefs.getBoolPref(p) !== torbutton_sec_h_bool_prefs[p]) {
if (m_tb_prefs.getBoolPref(p) === torbutton_sec_h_bool_prefs[p]) {
return;
}
}
if (!m_tb_prefs.getBoolPref("gfx.font_rendering.graphite.enabled")) {
return;