From d0c868fd7ffe970341497eaa0559b65a88974310 Mon Sep 17 00:00:00 2001 From: Kathy Brade Date: Tue, 29 Apr 2014 13:08:24 -0400 Subject: [PATCH] Bug 11641: change TBB directory structure to be more like Firefox's Unless the -osint command line flag is used, the browser now defaults to the equivalent of -no-remote. There is a new -allow-remote flag that may be used to restore the original (Firefox-like) default behavior. --- toolkit/xre/nsAppRunner.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index acc00cda49cdd..46cfa89d52e3b 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -1604,8 +1604,9 @@ DumpHelp() " --profile Start with profile at .\n" " --migration Start with migration wizard.\n" " --ProfileManager Start with ProfileManager.\n" - " --no-remote Do not accept or send remote commands; implies\n" + " --no-remote (default) Do not accept or send remote commands; implies\n" " --new-instance.\n" + " --allow-remote Accept and send remote commands.\n" " --new-instance Open new instance, not a new window in running instance.\n" " --UILocale Start with resources as UI Locale.\n" " --safe-mode Disables extensions and themes for this session.\n", gAppData->name); @@ -3661,6 +3662,12 @@ XREMain::XRE_mainInit(bool* aExitFlag) NS_LITERAL_CSTRING("0")); #endif + // In Tor Browser, remoting is disabled by default unless -osint is used. + bool allowRemote = (CheckArg("allow-remote") == ARG_FOUND); + if (!allowRemote && (CheckArg("osint", false, nullptr, false) != ARG_FOUND)) { + SaveToEnv("MOZ_NO_REMOTE=1"); + } + // Handle --no-remote and --new-instance command line arguments. Setup // the environment to better accommodate other components and various // restart scenarios. @@ -3668,8 +3675,9 @@ XREMain::XRE_mainInit(bool* aExitFlag) if (ar == ARG_BAD) { PR_fprintf(PR_STDERR, "Error: argument --no-remote is invalid when argument --osint is specified\n"); return 1; - } else if (ar == ARG_FOUND) { - SaveToEnv("MOZ_NO_REMOTE=1"); + } else if ((ar == ARG_FOUND) && allowRemote) { + PR_fprintf(PR_STDERR, "Error: argument --no-remote is invalid when argument --allow-remote is specified\n"); + return 1; } ar = CheckArg("new-instance", true); -- GitLab