This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch main in repository torbutton.
The following commit(s) were added to refs/heads/main by this push: new fb381b64 Bug 41352: Always show the link to the manual in about:tor fb381b64 is described below
commit fb381b649b92116d3f03a13313c5a051b792604c Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Tue Oct 11 19:13:21 2022 +0200
Bug 41352: Always show the link to the manual in about:tor --- chrome/content/aboutTor/aboutTor-content.js | 8 +------- chrome/content/preferences-mobile.js | 26 -------------------------- chrome/content/torbutton.js | 18 ------------------ chrome/skin/aboutTor.css | 3 +-- modules/utils.js | 7 ------- 5 files changed, 2 insertions(+), 60 deletions(-)
diff --git a/chrome/content/aboutTor/aboutTor-content.js b/chrome/content/aboutTor/aboutTor-content.js index 55bf4413..a35d95b5 100644 --- a/chrome/content/aboutTor/aboutTor-content.js +++ b/chrome/content/aboutTor/aboutTor-content.js @@ -19,7 +19,7 @@
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { bindPrefAndInit, show_torbrowser_manual } = ChromeUtils.import( +const { bindPrefAndInit } = ChromeUtils.import( "resource://torbutton/modules/utils.js" );
@@ -95,12 +95,6 @@ var AboutTorListener = { body.removeAttribute("toron"); }
- if (show_torbrowser_manual()) { - body.setAttribute("showmanual", "yes"); - } else { - body.removeAttribute("showmanual"); - } - if (aData.updateChannel) { body.setAttribute("updatechannel", aData.updateChannel); } else { diff --git a/chrome/content/preferences-mobile.js b/chrome/content/preferences-mobile.js index 92564e90..50cbfccd 100644 --- a/chrome/content/preferences-mobile.js +++ b/chrome/content/preferences-mobile.js @@ -10,10 +10,6 @@ const { getCharPref, } = Services.prefs;
-let { getLocale, show_torbrowser_manual } = ChromeUtils.import( - "resource://torbutton/modules/utils.js" -); - // Description elements have the follow names. const descNames = ["", "desc_standard", "desc_safer", "desc_safest"]; // "Learn-more"-elements have the follow names. @@ -51,7 +47,6 @@ function torbutton_init_security_ui() { getIntPref("extensions.torbutton.security_slider") ) ); - torbutton_set_learn_more_links(); }
// Write the two prefs from the current settings. @@ -62,24 +57,3 @@ 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 = show_torbrowser_manual(); - let locale = ""; - if (show_manual) { - locale = getLocale(); - } - 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; - } - }); -} diff --git a/chrome/content/torbutton.js b/chrome/content/torbutton.js index d89e5d55..3400a32a 100644 --- a/chrome/content/torbutton.js +++ b/chrome/content/torbutton.js @@ -19,7 +19,6 @@ var torbutton_new_circuit; */
let { - show_torbrowser_manual, unescapeTorString, bindPrefAndInit, getDomainForBrowser, @@ -275,12 +274,6 @@ var torbutton_new_circuit; torbutton_log(1, "registering Tor check observer"); torbutton_tor_check_observer.register();
- try { - torbutton_init_user_manual_links(); - } catch (e) { - torbutton_log(4, "Error loading the user manual " + e); - } - // Arrange for our about:tor content script to be loaded in each frame. window.messageManager.loadFrameScript( "chrome://torbutton/content/aboutTor/aboutTor-content.js", @@ -1042,16 +1035,5 @@ var torbutton_new_circuit; onStatusChange(aProgress, aRequest, stat, message) {}, onSecurityChange() {}, }; - - // Makes sure the item in the Help Menu and the link in about:tor - // for the Tor Browser User Manual are only visible when - // show_torbrowser_manual() returns true. - function torbutton_init_user_manual_links() { - let menuitem = document.getElementById("torBrowserUserManual"); - bindPrefAndInit("intl.locale.requested", val => { - menuitem.hidden = !show_torbrowser_manual(); - torbutton_abouttor_message_handler.updateAllOpenPages(); - }); - } })(); //vim:set ts=4 diff --git a/chrome/skin/aboutTor.css b/chrome/skin/aboutTor.css index da02130b..007c46d3 100644 --- a/chrome/skin/aboutTor.css +++ b/chrome/skin/aboutTor.css @@ -112,8 +112,7 @@ body:not([toron]) .hideIfTorOff { display: none; }
-body:not([hasbeenupdated]) .showIfHasBeenUpdated, -body:not([showmanual]) .showForManual { +body:not([hasbeenupdated]) .showIfHasBeenUpdated { display: none; }
diff --git a/modules/utils.js b/modules/utils.js index 7ccd2da1..49f7c0dc 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -208,13 +208,6 @@ var unescapeTorString = function(str) { return _torControl._strUnescape(str); };
-// Returns true if we should show the tor browser manual. -var show_torbrowser_manual = () => { - let availableLocales = ["de", "en", "es", "fr", "nl", "pt", "tr", "vi", "zh"]; - let shortLocale = getLocale().substring(0, 2); - return availableLocales.includes(shortLocale); -}; - var getFPDFromHost = hostname => { try { return Services.eTLD.getBaseDomainFromHost(hostname);