Commit 5d24d4b6 authored by Richard Pospesel's avatar Richard Pospesel Committed by Georg Koppen
Browse files

fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#tor

Fixes bug 32210 (hiding the tor pane when using system tor)
parent a9060232
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -93,7 +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();

+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@
              class="category"
              value="paneTor"
              helpTopic="prefs-tor"
              align="center">
              align="center"
              hidden="true">
  <image class="category-icon"/>
  <label id="torPreferences-labelCategory" class="category-name" flex="1" value="Tor"/>
</richlistitem>
+5 −0
Original line number Diff line number Diff line
@@ -478,6 +478,11 @@ const gTorPane = (function() {
      this._populateXUL();
    },

    // whether the page should be present in about:preferences
    get enabled() {
      return TorProtocolService.ownsTorDaemon;
    },

    //
    // Callbacks
    //
+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

<script type="application/javascript"
        src="chrome://browser/content/torpreferences/torPane.js"/>

<html:template id="template-paneTor">
<hbox id="torPreferencesCategory"
      class="subcategory"
      hidden="true"
@@ -117,3 +117,4 @@
    <button id="torPreferences-buttonTorLogs" class="torMarginFix" oncommand="gTorPane.onViewTorLogs();"/>
  </hbox>
</groupbox>
</html:template>
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
@@ -2,10 +2,15 @@

var EXPORTED_SYMBOLS = ["TorProtocolService"];

const { TorLauncherUtil } = ChromeUtils.import(
  "resource://torlauncher/modules/tl-util.jsm"
);

var TorProtocolService = {
  _tlps: Cc["@torproject.org/torlauncher-protocol-service;1"].getService(
    Ci.nsISupports
  ).wrappedJSObject,

  // maintain a map of tor settings set by Tor Browser so that we don't
  // repeatedly set the same key/values over and over
  // this map contains string keys to primitive or array values
@@ -199,4 +204,9 @@ var TorProtocolService = {
    let torLog = this._tlps.TorGetLog(countObj);
    return torLog;
  },

  // true if we launched and control tor, false if using system tor
  get ownsTorDaemon() {
    return TorLauncherUtil.shouldStartAndOwnTor;
  },
};