Commit 6ee07d83 authored by Richard Pospesel's avatar Richard Pospesel Committed by Matthew Finkel
Browse files

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
parent ae01a58c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ DIRS += [
    'syncedtabs',
    'uitour',
    'urlbar',
    'torpreferences',
    'translation',
]

+0 −15
Original line number Diff line number Diff line
@@ -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",
+0 −56
Original line number Diff line number Diff line
@@ -669,60 +669,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"
              icon="network"
              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-ssl,
                connection-proxy-ftp,
                connection-proxy-http-port,
                connection-proxy-socks,
                connection-proxy-socks4,
                connection-proxy-socks5,
                connection-proxy-noproxy,
                connection-proxy-noproxy-desc,
                connection-proxy-http-share.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>
+9 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
/* import-globals-from findInPage.js */
/* import-globals-from ../../../base/content/utilityOverlay.js */
/* import-globals-from ../../../../toolkit/content/preferencesBindings.js */
/* import-globals-from ../../torpreferences/content/torPane.js */
/* global MozXULElement */

"use strict";
@@ -92,6 +93,14 @@ function init_all() {
    document.getElementById("template-paneSync").remove();
  }
  register_module("paneSearchResults", gSearchResultsPane);
  if (gTorPane.enabled) {
    document.getElementById("category-tor").hidden = false;
    register_module("paneTor", gTorPane);
  } else {
    // Remove the pane from the DOM so it doesn't get incorrectly included in search results.
    document.getElementById("template-paneTor").remove();
  }

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

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

<!DOCTYPE page [
<!ENTITY % aboutTorDTD SYSTEM "chrome://torbutton/locale/aboutTor.dtd">
@@ -138,6 +139,9 @@
          <image class="category-icon"/>
          <label class="category-name" flex="1" data-l10n-id="pane-sync-title2"></label>
        </richlistitem>

#include ../../torpreferences/content/torCategory.inc.xul

      </richlistbox>

      <spacer flex="1"/>
@@ -195,6 +199,7 @@
#include privacy.xul
#include containers.xul
#include sync.xul
#include ../../torpreferences/content/torPane.xul
        </vbox>
      </vbox>
    </vbox>
Loading