Unverified Commit 0e9fe510 authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 21847: Update copy for security slider

We update the copy of our desktop security slider following the experience
provided for mobile users.
parent 787d4113
......@@ -2,14 +2,17 @@
// Utilities
let { utils: Cu } = Components;
let { getBoolPref, getIntPref, setBoolPref, setIntPref } =
let { getBoolPref, getIntPref, setBoolPref, setIntPref, getCharPref } =
Cu.import("resource://gre/modules/Services.jsm", {}).Services.prefs;
// Description elements have the follow names.
const descNames =
[, "desc_high", "desc_medium", "desc_low"];
[, "desc_safest", "desc_safer", "desc_standard"];
// "Learn-more"-elements have the follow names.
const linkNames =
[, "link_safest", "link_safer", "link_standard"];
// A single `state` object that reflects the user settings in this UI.
let state = { slider : 0, custom : false};
// Utility functions to convert between the legacy 4-value pref index
......@@ -41,7 +44,12 @@ function torbutton_init_security_ui() {
torbutton_set_slider(prefSettingToSliderPosition(
getIntPref("extensions.torbutton.security_slider")));
torbutton_set_custom(getBoolPref("extensions.torbutton.security_custom"));
torbutton_set_learn_more_links();
// Make sure the "Accept"-button is focused when we show the dialog and not a
// possible "Learn more"-link. See: comment:16 in bug 21847.
let okBtn = document.documentElement.getButton("accept");
if (okBtn)
okBtn.focus();
setTimeout(adjustDialogSize, 0);
};
......@@ -52,6 +60,27 @@ function torbutton_save_security_settings() {
setBoolPref("extensions.torbutton.security_custom", state.custom);
};
// We follow the way we treat the links to the Tor Browser User Manual on the
// Help Menu and on about:tor: if we have the manual available for a locale,
// let's show the "Learn more"-link, otherwise hide it.
function torbutton_set_learn_more_links() {
let show_manual = window.opener.torbutton_show_torbrowser_manual();
let locale = ""
if (show_manual) {
locale = getCharPref('general.useragent.locale');
}
let links = linkNames.map(name => document.getElementById(name));
links.forEach(link => {;
if (show_manual && locale != "") {
link.href= "https:/tb-manual.torproject.org/" + locale +
"/security-slider.html";
link.hidden = false;
} else {
link.hidden = true;
}
});
}
// Increase the height of this window so that a vertical scrollbar is not
// needed on the description box.
function adjustDialogSize() {
......
......@@ -34,98 +34,85 @@
</vbox>
<vbox>
<hbox flex="1" align="start">
<description id="torbutton_sec_high"
<description id="torbutton_sec_safest"
onclick="torbutton_set_slider(1);"
tooltip="high_preview">
&torbutton.prefs.sec_high;
tooltip="safest_preview">
&torbutton.prefs.sec_safest_label;
</description>
</hbox>
<hbox flex="1" align="center">
<description id="torbutton_sec_medium"
<description id="torbutton_sec_safer"
onclick="torbutton_set_slider(2);"
tooltip="medium_preview">
&torbutton.prefs.sec_medium;
tooltip="safer_preview">
&torbutton.prefs.sec_safer_label;
</description>
</hbox>
<hbox flex="1" align="end">
<description id="torbutton_sec_low"
<description id="torbutton_sec_standard"
onclick="torbutton_set_slider(3);"
tooltip="low_preview">
&torbutton.prefs.sec_low;
tooltip="standard_preview">
&torbutton.prefs.sec_standard_label;
</description>
</hbox>
</vbox>
</hbox>
</vbox>
<vbox id="descBox" flex="1" style="overflow: hidden;">
<vbox id="desc_high" collapsed="true">
<vbox id="desc_safest" collapsed="true">
<description
class="slider-text-size, slider-text-weight">
&torbutton.prefs.sec_gen_desc;
&torbutton.prefs.sec_safest_description;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_js_desc_tooltip;">
&torbutton.prefs.sec_all_js_desc;
<separator orient="horizontal" class="thin"/>
<description class="slider-text-size, slider-text-weight">
&torbutton.prefs.sec_safest_list_label;
</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_html5_tooltip;">
&torbutton.prefs.sec_html5_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_desc;
<description class="slider-text-size">
&torbutton.prefs.sec_js_disabled;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_svg_desc_tooltip;">
&torbutton.prefs.sec_svg_desc;
<description class="slider-text-size">
&torbutton.prefs.sec_limit_graphics_and_typography;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_webfonts_desc_tooltip;">
&torbutton.prefs.sec_webfonts_desc;
<description class="slider-text-size">
&torbutton.prefs.sec_click_to_play_media;
</description>
<separator orient="horizontal" class="thin"/>
<label id="link_safest" class="text-link">
&torbutton.prefs.sec_learn_more_label;
</label>
</vbox>
<vbox id="desc_medium" collapsed="true">
<vbox id="desc_safer" 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_js_desc_tooltip;">
&torbutton.prefs.sec_js_https_desc;
&torbutton.prefs.sec_safer_description;
</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;
<separator orient="horizontal" class="thin"/>
<description class="slider-text-size, slider-text-weight">
&torbutton.prefs.sec_safer_list_label;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_html5_tooltip;">
&torbutton.prefs.sec_html5_desc;
<description class="slider-text-size">
&torbutton.prefs.sec_js_on_https_sites_only;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_mathml_desc_tooltip;">
&torbutton.prefs.sec_mathml_desc;
<description class="slider-text-size">
&torbutton.prefs.sec_limit_typography;
</description>
<description class="slider-text-size"
tooltiptext="&torbutton.prefs.sec_font_rend_svg_tooltip;">
&torbutton.prefs.sec_font_rend_desc;
<description class="slider-text-size">
&torbutton.prefs.sec_click_to_play_media;
</description>
<separator orient="horizontal" class="thin"/>
<label id="link_safer" class="text-link">
&torbutton.prefs.sec_learn_more_label;
</label>
</vbox>
<vbox id="desc_low" collapsed="false">
<vbox id="desc_standard" 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;
&torbutton.prefs.sec_standard_description;
</description>
<separator orient="horizontal" class="thin"/>
<label id="link_standard" class="text-link">
&torbutton.prefs.sec_learn_more_label;
</label>
</vbox>
</vbox>
</hbox>
......@@ -146,32 +133,23 @@
</groupbox>
</vbox>
<tooltip id="high_preview">
<html:b>&torbutton.prefs.sec_gen_desc;</html:b>
<tooltip id="safest_preview">
<html:b>&torbutton.prefs.sec_safest_list_label;</html:b>
<html:br></html:br>
<html:br></html:br>
<html:div>&torbutton.prefs.sec_all_js_desc;</html:div>
<html:div>&torbutton.prefs.sec_all_jit_desc; &torbutton.prefs.sec_jit_slower_desc;</html:div>
<html:div>&torbutton.prefs.sec_html5_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_svg_desc;</html:div>
<html:div>&torbutton.prefs.sec_webfonts_desc;</html:div>
<html:div>&torbutton.prefs.sec_js_disabled;</html:div>
<html:div>&torbutton.prefs.sec_limit_graphics_and_typography;</html:div>
<html:div>&torbutton.prefs.sec_click_to_play_media;</html:div>
</tooltip>
<tooltip id="medium_preview">
<html:b>&torbutton.prefs.sec_gen_desc;</html:b>
<tooltip id="safer_preview">
<html:b>&torbutton.prefs.sec_safer_list_label;</html:b>
<html:br></html:br>
<html:br></html:br>
<html:div>&torbutton.prefs.sec_js_https_desc;</html:div>
<html:div>&torbutton.prefs.sec_all_jit_desc; &torbutton.prefs.sec_jit_slower_desc;</html:div>
<html:div>&torbutton.prefs.sec_html5_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_on_https_sites_only;</html:div>
<html:div>&torbutton.prefs.sec_limit_typography;</html:div>
<html:div>&torbutton.prefs.sec_click_to_play_media;</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 id="standard_preview">
<html:b>&torbutton.prefs.sec_standard_description;</html:b>
</tooltip>
</dialog>
......@@ -33,29 +33,18 @@
<!ENTITY torbutton.prefs.resist_fingerprinting_tooltip "Keep this box checked to hide things from websites that could be unique about you, including your computer performance, keyboard layout, locale, the location of installed plugins, the list of installed plugins, your network status, screen orientation, screen size, site-specific zoom levels, supported file types, system colors, and WebGL capabilities.">
<!ENTITY torbutton.prefs.sec_caption "Security Level">
<!ENTITY torbutton.prefs.sec_caption_tooltip "The Security Slider lets you disable certain browser features that may make your browser more vulnerable to hacking attempts.">
<!ENTITY torbutton.prefs.sec_low "Low (default)">
<!ENTITY torbutton.prefs.sec_low_usable_desc "This provides the most usable experience.">
<!ENTITY torbutton.prefs.sec_low_desc "At this security level, all browser features are enabled.">
<!ENTITY torbutton.prefs.sec_font_rend_svg_tooltip "The SVG OpenType font rendering mechanism is disabled.">
<!ENTITY torbutton.prefs.sec_gen_desc "At this security level, the following changes apply (mouseover for details):">
<!ENTITY torbutton.prefs.sec_html5_desc "HTML5 video and audio media become click-to-play via NoScript.">
<!ENTITY torbutton.prefs.sec_html5_tooltip "On some sites, you might need to use the NoScript toolbar button to enable these media objects.">
<!ENTITY torbutton.prefs.sec_some_jit_desc "Some JavaScript performance optimizations are disabled.">
<!ENTITY torbutton.prefs.sec_jit_desc_tooltip "ION JIT, Native RegExp.">
<!ENTITY torbutton.prefs.sec_baseline_jit_desc_tooltip "Baseline JIT.">
<!ENTITY torbutton.prefs.sec_jit_slower_desc "Scripts on some sites may run slower.">
<!ENTITY torbutton.prefs.sec_mathml_desc "Some mechanisms of displaying math equations are disabled.">
<!ENTITY torbutton.prefs.sec_mathml_desc_tooltip "MathML is disabled.">
<!ENTITY torbutton.prefs.sec_medium "Medium">
<!ENTITY torbutton.prefs.sec_all_jit_desc "On sites where JavaScript is enabled, performance optimizations are disabled.">
<!ENTITY torbutton.prefs.sec_font_rend_desc "Some font rendering features are disabled.">
<!ENTITY torbutton.prefs.sec_font_rend_graphite_tooltip "The Graphite font rendering mechanism is disabled.">
<!ENTITY torbutton.prefs.sec_svg_desc "Some types of images are disabled.">
<!ENTITY torbutton.prefs.sec_svg_desc_tooltip "SVG images are disabled.">
<!ENTITY torbutton.prefs.sec_js_https_desc "JavaScript is disabled by default on all non-HTTPS sites.">
<!ENTITY torbutton.prefs.sec_js_desc_tooltip "JavaScript can be enabled on a per-site basis via the NoScript toolbar button.">
<!ENTITY torbutton.prefs.sec_high "High">
<!ENTITY torbutton.prefs.sec_all_js_desc "JavaScript is disabled by default on all sites.">
<!ENTITY torbutton.prefs.sec_webfonts_desc "Some fonts and icons may display incorrectly.">
<!ENTITY torbutton.prefs.sec_webfonts_desc_tooltip "Website-provided font files are blocked.">
<!ENTITY torbutton.prefs.sec_standard_label "Standard">
<!ENTITY torbutton.prefs.sec_standard_description "All Tor Browser and website features are enabled.">
<!ENTITY torbutton.prefs.sec_safer_label "Safer">
<!ENTITY torbutton.prefs.sec_safer_description "Disables website features that are often dangerous, causing some sites to lose functionality.">
<!ENTITY torbutton.prefs.sec_safer_list_label "At the safer setting:">
<!ENTITY torbutton.prefs.sec_safest_label "Safest">
<!ENTITY torbutton.prefs.sec_safest_description "Only allows website features required for static sites and basic services. These changes affect images, media, and scripts.">
<!ENTITY torbutton.prefs.sec_safest_list_label "At the safest setting:">
<!ENTITY torbutton.prefs.sec_learn_more_label "Learn more">
<!ENTITY torbutton.prefs.sec_js_on_https_sites_only "JavaScript is disabled on non-HTTPS sites.">
<!ENTITY torbutton.prefs.sec_js_disabled "JavaScript is disabled by default on all sites.">
<!ENTITY torbutton.prefs.sec_limit_typography "Some fonts and math symbols are disabled.">
<!ENTITY torbutton.prefs.sec_limit_graphics_and_typography "Some fonts, icons, math symbols, and images are disabled.">
<!ENTITY torbutton.prefs.sec_click_to_play_media "Audio and video (HTML5 media) are click-to-play.">
<!ENTITY torbutton.circuit_display.title "Tor circuit for this site">
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