From 8f58a9a7f48d8268ff99e4f11565fcf88134862f Mon Sep 17 00:00:00 2001 From: Richard Pospesel Date: Mon, 16 Sep 2019 15:25:39 -0700 Subject: [PATCH] Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#tor This patch adds a new about:preferences#tor page which allows modifying bridge, proxy, and firewall settings from within Tor Browser. All of the functionality present in tor-launcher's Network Configuration panel is present: - Setting built-in bridges - Requesting bridges from BridgeDB via moat - Using user-provided bridges - Configuring SOCKS4, SOCKS5, and HTTP/HTTPS proxies - Setting firewall ports - Viewing and Copying Tor's logs In addition the following changes have been made: - The Networking Settings in General preferences has been removed - TorStrings has been removed from the SecurityLevel component and moved into a common shared module also used by about:preferences#tor --- browser/components/moz.build | 1 + .../components/preferences/in-content/main.js | 15 - .../preferences/in-content/main.xul | 56 -- .../preferences/in-content/preferences.js | 9 + .../preferences/in-content/preferences.xul | 5 + .../preferences/in-content/privacy.js | 1 + .../securitylevel/content/securityLevel.js | 153 +--- .../torpreferences/content/parseFunctions.jsm | 76 ++ .../content/requestBridgeDialog.jsm | 220 +++++ .../content/requestBridgeDialog.xul | 35 + .../content/torBridgeSettings.jsm | 325 +++++++ .../content/torCategory.inc.xul | 9 + .../content/torFirewallSettings.jsm | 72 ++ .../torpreferences/content/torLogDialog.jsm | 65 ++ .../torpreferences/content/torLogDialog.xul | 22 + .../torpreferences/content/torPane.js | 807 ++++++++++++++++++ .../torpreferences/content/torPane.xul | 125 +++ .../torpreferences/content/torPreferences.css | 63 ++ .../content/torPreferencesIcon.svg | 5 + .../content/torProxySettings.jsm | 245 ++++++ browser/components/torpreferences/jar.mn | 14 + browser/components/torpreferences/moz.build | 1 + browser/modules/BridgeDB.jsm | 110 +++ browser/modules/TorProtocolService.jsm | 212 +++++ browser/modules/TorStrings.jsm | 326 +++++++ browser/modules/moz.build | 3 + 26 files changed, 2782 insertions(+), 193 deletions(-) create mode 100644 browser/components/torpreferences/content/parseFunctions.jsm create mode 100644 browser/components/torpreferences/content/requestBridgeDialog.jsm create mode 100644 browser/components/torpreferences/content/requestBridgeDialog.xul create mode 100644 browser/components/torpreferences/content/torBridgeSettings.jsm create mode 100644 browser/components/torpreferences/content/torCategory.inc.xul create mode 100644 browser/components/torpreferences/content/torFirewallSettings.jsm create mode 100644 browser/components/torpreferences/content/torLogDialog.jsm create mode 100644 browser/components/torpreferences/content/torLogDialog.xul create mode 100644 browser/components/torpreferences/content/torPane.js create mode 100644 browser/components/torpreferences/content/torPane.xul create mode 100644 browser/components/torpreferences/content/torPreferences.css create mode 100644 browser/components/torpreferences/content/torPreferencesIcon.svg create mode 100644 browser/components/torpreferences/content/torProxySettings.jsm create mode 100644 browser/components/torpreferences/jar.mn create mode 100644 browser/components/torpreferences/moz.build create mode 100644 browser/modules/BridgeDB.jsm create mode 100644 browser/modules/TorProtocolService.jsm create mode 100644 browser/modules/TorStrings.jsm diff --git a/browser/components/moz.build b/browser/components/moz.build index 111794a7532c0..c0c9629cac653 100644 --- a/browser/components/moz.build +++ b/browser/components/moz.build @@ -56,6 +56,7 @@ DIRS += [ 'syncedtabs', 'uitour', 'urlbar', + 'torpreferences', 'translation', ] diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js index 0e2956b067333..d9c51bb26aeb7 100644 --- a/browser/components/preferences/in-content/main.js +++ b/browser/components/preferences/in-content/main.js @@ -365,16 +365,6 @@ var gMainPane = { }); this.updatePerformanceSettingsBox({ duringChangeEvent: false }); - let connectionSettingsLink = document.getElementById( - "connectionSettingsLearnMore" - ); - let connectionSettingsUrl = - Services.urlFormatter.formatURLPref("app.support.baseURL") + - "prefs-connection-settings"; - connectionSettingsLink.setAttribute("href", connectionSettingsUrl); - this.updateProxySettingsUI(); - initializeProxyUI(gMainPane); - if (Services.prefs.getBoolPref("intl.multilingual.enabled")) { gMainPane.initBrowserLocale(); } @@ -463,11 +453,6 @@ var gMainPane = { "change", gMainPane.updateHardwareAcceleration.bind(gMainPane) ); - setEventListener( - "connectionSettings", - "command", - gMainPane.showConnections - ); setEventListener( "browserContainersCheckbox", "command", diff --git a/browser/components/preferences/in-content/main.xul b/browser/components/preferences/in-content/main.xul index 83d64f26a62d7..85a219ff783b5 100644 --- a/browser/components/preferences/in-content/main.xul +++ b/browser/components/preferences/in-content/main.xul @@ -669,60 +669,4 @@