GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit a232915e authored by Tails developers's avatar Tails developers Committed by Kathleen Brade
Browse files

Bug #11077: Always show wizard if TOR_FORCE_NET_CONFIG=1

parent d53bcc2e
......@@ -270,9 +270,6 @@ TorProcessService.prototype =
{
this.mTorProcessStatus = this.kStatusUnknown;
var isInitialBootstrap =
TorLauncherUtil.getBoolPref(this.kPrefPromptAtStartup);
try
{
// Ideally, we would cd to the Firefox application directory before
......@@ -329,7 +326,7 @@ TorProcessService.prototype =
args.push("" + pid);
}
if (isInitialBootstrap)
if (TorLauncherUtil.shouldShowNetworkSettings)
{
args.push("DisableNetwork");
args.push("1");
......@@ -360,14 +357,11 @@ TorProcessService.prototype =
_controlTor: function()
{
var isInitialBootstrap =
TorLauncherUtil.getBoolPref(this.kPrefPromptAtStartup);
try
{
this._monitorTorProcessStartup();
if (isInitialBootstrap)
if (TorLauncherUtil.shouldShowNetworkSettings)
{
if (this.mProtocolSvc)
this._openNetworkSettings(true); // Blocks until dialog is closed.
......
......@@ -197,6 +197,22 @@ let TorLauncherUtil = // Public
return this.getBoolPref(kPrefStartTor, true);
},
get shouldShowNetworkSettings()
{
const kPrefPromptAtStartup = "extensions.torlauncher.prompt_at_startup";
try
{
const kEnvForceShowNetConfig = "TOR_FORCE_NET_CONFIG";
var env = Cc["@mozilla.org/process/environment;1"]
.getService(Ci.nsIEnvironment);
if (env.exists(kEnvForceShowNetConfig))
return ("1" == env.get(kEnvForceShowNetConfig));
} catch(e) {}
return this.getBoolPref(kPrefPromptAtStartup, true);
},
get shouldOnlyConfigureTor()
{
const kPrefOnlyConfigureTor = "extensions.torlauncher.only_configure_tor";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment