Verified Commit b7b938b2 authored by Richard Pospesel's avatar Richard Pospesel Committed by ma1
Browse files

Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection

This patch adds a new about:preferences#connection 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
 - The Networking Settings in General preferences has been removed

Bug 40774: Update about:preferences page to match new UI designs
parent 7b4886ad
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ DIRS += [
    "uitour",
    "urlbar",
    "torcircuit",
    "torpreferences",
]

DIRS += ["build"]
+0 −54
Original line number Diff line number Diff line
@@ -753,58 +753,4 @@
    <label id="cfrFeaturesLearnMore" class="learnMore" data-l10n-id="browsing-cfr-recommendations-learn-more" is="text-link"/>
  </hbox>
</groupbox>

<hbox id="networkProxyCategory"
      class="subcategory"
      hidden="true"
      data-category="paneGeneral">
  <html:h1 data-l10n-id="network-settings-title"/>
</hbox>

<!-- Network Settings-->
<groupbox id="connectionGroup" data-category="paneGeneral" hidden="true">
  <label class="search-header" hidden="true"><html:h2 data-l10n-id="network-settings-title"/></label>

  <hbox align="center">
    <hbox align="center" flex="1">
      <description id="connectionSettingsDescription" control="connectionSettings"/>
      <spacer width="5"/>
      <label id="connectionSettingsLearnMore" class="learnMore" is="text-link"
        data-l10n-id="network-proxy-connection-learn-more">
      </label>
      <separator orient="vertical"/>
    </hbox>

    <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
    <hbox>
      <button id="connectionSettings"
              is="highlightable-button"
              class="accessory-button"
              data-l10n-id="network-proxy-connection-settings"
              searchkeywords="doh trr"
              search-l10n-ids="
                connection-window.title,
                connection-proxy-option-no.label,
                connection-proxy-option-auto.label,
                connection-proxy-option-system.label,
                connection-proxy-option-manual.label,
                connection-proxy-http,
                connection-proxy-https,
                connection-proxy-http-port,
                connection-proxy-socks,
                connection-proxy-socks4,
                connection-proxy-socks5,
                connection-proxy-noproxy,
                connection-proxy-noproxy-desc,
                connection-proxy-https-sharing.label,
                connection-proxy-autotype.label,
                connection-proxy-reload.label,
                connection-proxy-autologin.label,
                connection-proxy-socks-remote-dns.label,
                connection-dns-over-https.label,
                connection-dns-over-https-url-custom.label,
            " />
    </hbox>
  </hbox>
</groupbox>
</html:template>
+0 −14
Original line number Diff line number Diff line
@@ -329,15 +329,6 @@ var gMainPane = {
    });
    this.updatePerformanceSettingsBox({ duringChangeEvent: false });
    this.displayUseSystemLocale();
    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.initPrimaryBrowserLanguageUI();
@@ -490,11 +481,6 @@ var gMainPane = {
      "change",
      gMainPane.updateHardwareAcceleration.bind(gMainPane)
    );
    setEventListener(
      "connectionSettings",
      "command",
      gMainPane.showConnections
    );
    setEventListener(
      "browserContainersCheckbox",
      "command",
+9 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
/* import-globals-from findInPage.js */
/* import-globals-from /browser/base/content/utilityOverlay.js */
/* import-globals-from /toolkit/content/preferencesBindings.js */
/* import-globals-from ../torpreferences/content/connectionPane.js */

"use strict";

@@ -219,6 +220,14 @@ function init_all() {
    register_module("paneSync", gSyncPane);
  }
  register_module("paneSearchResults", gSearchResultsPane);
  if (gConnectionPane.enabled) {
    document.getElementById("category-connection").hidden = false;
    register_module("paneConnection", gConnectionPane);
  } else {
    // Remove the pane from the DOM so it doesn't get incorrectly included in search results.
    document.getElementById("template-paneConnection").remove();
  }

  gSearchResultsPane.init();
  gMainPane.preInit();

+5 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/privacy.css"?>
<?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelPreferences.css"?>
<?xml-stylesheet href="chrome://browser/content/torpreferences/torPreferences.css"?>

<!DOCTYPE html [
<!ENTITY % aboutTorDTD SYSTEM "chrome://torbutton/locale/aboutTor.dtd">
@@ -166,6 +167,9 @@
          <image class="category-icon"/>
          <label class="category-name" flex="1" data-l10n-id="more-from-moz-title"></label>
        </richlistitem>

#include ../torpreferences/content/connectionCategory.inc.xhtml

      </richlistbox>

      <spacer flex="1"/>
@@ -215,6 +219,7 @@
#include sync.inc.xhtml
#include experimental.inc.xhtml
#include moreFromMozilla.inc.xhtml
#include ../torpreferences/content/connectionPane.xhtml
        </vbox>
      </vbox>
    </vbox>
Loading