Loading browser/components/preferences/in-content/preferences.js +8 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading browser/components/torpreferences/content/torCategory.inc.xul +2 −1 Original line number Diff line number Diff line Loading @@ -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> browser/components/torpreferences/content/torPane.js +5 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,11 @@ const gTorPane = (function() { this._populateXUL(); }, // whether the page should be present in about:preferences get enabled() { return TorProtocolService.ownsTorDaemon; }, // // Callbacks // Loading browser/components/torpreferences/content/torPane.xul +2 −1 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -117,3 +117,4 @@ <button id="torPreferences-buttonTorLogs" class="torMarginFix" oncommand="gTorPane.onViewTorLogs();"/> </hbox> </groupbox> </html:template> No newline at end of file browser/modules/TorProtocolService.jsm +10 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; }, }; Loading
browser/components/preferences/in-content/preferences.js +8 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading
browser/components/torpreferences/content/torCategory.inc.xul +2 −1 Original line number Diff line number Diff line Loading @@ -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>
browser/components/torpreferences/content/torPane.js +5 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,11 @@ const gTorPane = (function() { this._populateXUL(); }, // whether the page should be present in about:preferences get enabled() { return TorProtocolService.ownsTorDaemon; }, // // Callbacks // Loading
browser/components/torpreferences/content/torPane.xul +2 −1 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -117,3 +117,4 @@ <button id="torPreferences-buttonTorLogs" class="torMarginFix" oncommand="gTorPane.onViewTorLogs();"/> </hbox> </groupbox> </html:template> No newline at end of file
browser/modules/TorProtocolService.jsm +10 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; }, };