Commit 6c67c31e authored by Richard Pospesel's avatar Richard Pospesel
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 98090f27
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ DIRS += [
    "syncedtabs",
    "uitour",
    "urlbar",
    "torpreferences",
    "translation",
]

+0 −54
Original line number Diff line number Diff line
@@ -671,58 +671,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
@@ -368,15 +368,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.initBrowserLocale();
@@ -510,11 +501,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
@@ -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/connectionPane.js */

"use strict";

@@ -136,6 +137,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();

+6 −0
Original line number Diff line number Diff line
@@ -6,12 +6,14 @@
<?xml-stylesheet href="chrome://global/skin/global.css"?>

<?xml-stylesheet href="chrome://global/skin/in-content/common.css"?>
<?xml-stylesheet href="chrome://global/skin/in-content/toggle-button.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://browser/content/preferences/dialogs/handlers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/search.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/privacy.css"?>
<?xml-stylesheet href="chrome://browser/content/torpreferences/torPreferences.css"?>

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

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

      </richlistbox>

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