diff -urN firefox-154.0-orig/browser/base/content/test/performance/browser_startup_mainthreadio.js firefox-154.0/browser/base/content/test/performance/browser_startup_mainthreadio.js --- firefox-154.0-orig/browser/base/content/test/performance/browser_startup_mainthreadio.js 2026-08-13 06:13:24 +0900 +++ firefox-154.0/browser/base/content/test/performance/browser_startup_mainthreadio.js 2026-08-20 11:11:39 +0900 @@ -202,12 +202,6 @@ read: 1, close: 1, }, - { - // This is the startup lock used to restrict only one Firefox startup at a time. - path: `TmpD:firefox-${AppConstants.MOZ_UPDATE_CHANNEL}/parent.lock`, - condition: WIN, - stat: 1, - }, ], "before opening first browser window": [ diff -urN firefox-154.0-orig/browser/components/shell/test/head.js firefox-154.0/browser/components/shell/test/head.js --- firefox-154.0-orig/browser/components/shell/test/head.js 2026-08-13 06:13:25 +0900 +++ firefox-154.0/browser/components/shell/test/head.js 2026-08-20 11:11:39 +0900 @@ -20,7 +20,7 @@ "headless_test_screenshot_profile" ); const prefsPath = PathUtils.join(profilePath, mochiPrefsName); - const firefoxArgs = ["-profile", profilePath]; + const firefoxArgs = ["-profile", profilePath, "-no-remote"]; await IOUtils.makeDirectory(profilePath); await IOUtils.copy(mochiPrefsPath, prefsPath); diff -urN firefox-154.0-orig/docs/contributing/debugging/debugging_firefox_with_lldb.md firefox-154.0/docs/contributing/debugging/debugging_firefox_with_lldb.md --- firefox-154.0-orig/docs/contributing/debugging/debugging_firefox_with_lldb.md 2026-08-13 06:13:25 +0900 +++ firefox-154.0/docs/contributing/debugging/debugging_firefox_with_lldb.md 2026-08-20 11:17:07 +0900 @@ -59,7 +59,7 @@ followed by the command line you'd like to run, like this: ```bash -lldb -- obj-ff-dbg/dist/Nightly.app/Contents/MacOS/firefox -profile /path/to/profile +lldb -- obj-ff-dbg/dist/Nightly.app/Contents/MacOS/firefox -no-remote -profile /path/to/profile ``` Then set breakpoints you need and start the process: diff -urN firefox-154.0-orig/docs/contributing/debugging/debugging_on_macos.md firefox-154.0/docs/contributing/debugging/debugging_on_macos.md --- firefox-154.0-orig/docs/contributing/debugging/debugging_on_macos.md 2026-08-13 06:13:25 +0900 +++ firefox-154.0/docs/contributing/debugging/debugging_on_macos.md 2026-08-20 11:16:40 +0900 @@ -160,7 +160,8 @@ debugging purposes" below. Select "Run" from the left hand side and in the "Arguments" tab in the scheme editor, and click the '+' below the "Arguments passed on launch" field. Add "-P *profilename*", where - *profilename* is the name of a profile you created previously. + *profilename* is the name of a profile you created previously. Repeat + that to also add the argument "-no-remote". 6. Also in the "Arguments" panel, you may want to add an environment variable MOZ_DEBUG_CHILD_PROCESS set to the value 1 to help with debugging. diff -urN firefox-154.0-orig/docs/contributing/debugging/debugging_on_windows.md firefox-154.0/docs/contributing/debugging/debugging_on_windows.md --- firefox-154.0-orig/docs/contributing/debugging/debugging_on_windows.md 2026-08-13 06:13:25 +0900 +++ firefox-154.0/docs/contributing/debugging/debugging_on_windows.md 2026-08-20 11:14:23 +0900 @@ -250,7 +250,18 @@ ## Running two instances of Mozilla simultaneously You can run two instances of Mozilla (e.g. debug and optimized) -simultaneously by specifying the profile to use with the `-P profile_name` +simultaneously by setting the environment variable `MOZ_NO_REMOTE`: + +``` +set MOZ_NO_REMOTE=1 +``` + +Or, starting with Firefox 2 and other Gecko 1.8.1-based applications, +you can use the ``-no-remote`` command-line switch instead (implemented +in +[bug 325509](https://bugzilla.mozilla.org/show_bug.cgi?id=325509)). + +You can also specify the profile to use with the ``-P profile_name`` command-line argument. ## Debugging JavaScript diff -urN firefox-154.0-orig/docs/performance/jit_profiling_with_perf.md firefox-154.0/docs/performance/jit_profiling_with_perf.md --- firefox-154.0-orig/docs/performance/jit_profiling_with_perf.md 2026-08-13 06:13:26 +0900 +++ firefox-154.0/docs/performance/jit_profiling_with_perf.md 2026-08-20 11:12:29 +0900 @@ -94,7 +94,7 @@ Run the Firefox browser ``` -~/mozilla-central/obj-opt64/dist/bin/firefox -profile ~/mozilla-central/obj-opt64/tmp/profile-default & +~/mozilla-central/obj-opt64/dist/bin/firefox -no-remote -profile ~/mozilla-central/obj-opt64/tmp/profile-default & ``` Navigate to the test case, but do not start it yet. Then hover over the tab to get the content process PID. diff -urN firefox-154.0-orig/docs/performance/profiling_with_xperf.md firefox-154.0/docs/performance/profiling_with_xperf.md --- firefox-154.0-orig/docs/performance/profiling_with_xperf.md 2026-08-13 06:13:26 +0900 +++ firefox-154.0/docs/performance/profiling_with_xperf.md 2026-08-20 11:12:29 +0900 @@ -121,7 +121,7 @@ To start a trace session, launching a new Firefox instance: -`xperf -on base xperf -start heapsession -heap -PidNewProcess "./firefox.exe -P test" -stackwalk HeapAlloc+HeapRealloc -BufferSize 512 -MinBuffers 128 -MaxBuffers 512` +`xperf -on base xperf -start heapsession -heap -PidNewProcess "./firefox.exe -P test -no-remote" -stackwalk HeapAlloc+HeapRealloc -BufferSize 512 -MinBuffers 128 -MaxBuffers 512` To stop a session and merge the resulting files: diff -urN firefox-154.0-orig/layout/tools/reftest/remotereftest.py firefox-154.0/layout/tools/reftest/remotereftest.py --- firefox-154.0-orig/layout/tools/reftest/remotereftest.py 2026-08-13 06:13:32 +0900 +++ firefox-154.0/layout/tools/reftest/remotereftest.py 2026-08-20 11:12:29 +0900 @@ -432,7 +432,7 @@ startTime = datetime.datetime.now() status = 0 profileDirectory = self.remoteProfile + "/" - cmdargs.extend(("-profile", profileDirectory)) + cmdargs.extend(("-no-remote", "-profile", profileDirectory)) pid = rpm.launch( binary, diff -urN firefox-154.0-orig/python/mozbuild/mozbuild/mach_commands.py firefox-154.0/python/mozbuild/mozbuild/mach_commands.py --- firefox-154.0-orig/python/mozbuild/mozbuild/mach_commands.py 2026-08-13 06:13:33 +0900 +++ firefox-154.0/python/mozbuild/mozbuild/mach_commands.py 2026-08-20 11:12:29 +0900 @@ -1908,6 +1908,12 @@ "--app", help="Path to executable to run (default: output of ./mach build)" ) group.add_argument( + "--remote", + "-r", + action="store_true", + help="Do not pass the --no-remote argument by default.", + ) + group.add_argument( "--background", "-b", action="store_true", @@ -2471,6 +2477,7 @@ params, packaged, app, + remote, background, noprofile, appdata, @@ -2556,6 +2563,9 @@ if params: args.extend(params) + if not remote: + args.append("-no-remote") + if not background and sys.platform == "darwin": args.append("-foreground") @@ -3795,7 +3805,7 @@ logging.INFO, "repackage-snap-install-howto-run", {}, - f"Example usage: snap run {snap_name}", + f"Example usage: snap run {snap_name} --no-remote", ) return 0 diff -urN firefox-154.0-orig/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts firefox-154.0/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts --- firefox-154.0-orig/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts 2026-08-13 06:13:35 +0900 +++ firefox-154.0/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts 2026-08-20 11:12:29 +0900 @@ -59,7 +59,7 @@ it('should launch a Firefox browser', async () => { const userDataDir = path.join(tmpDir, 'profile'); function getArgs(): string[] { - const firefoxArguments = []; + const firefoxArguments = ['--no-remote']; switch (os.platform()) { case 'darwin': firefoxArguments.push('--foreground'); diff -urN firefox-154.0-orig/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts firefox-154.0/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts --- firefox-154.0-orig/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts 2026-08-13 06:13:34 +0900 +++ firefox-154.0/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts 2026-08-20 11:12:29 +0900 @@ -184,7 +184,7 @@ userDataDir = null, } = options; - const firefoxArguments = []; + const firefoxArguments = ['--no-remote']; switch (os.platform()) { case 'darwin': diff -urN firefox-154.0-orig/remote/test/puppeteer/test/src/launcher.spec.ts firefox-154.0/remote/test/puppeteer/test/src/launcher.spec.ts --- firefox-154.0-orig/remote/test/puppeteer/test/src/launcher.spec.ts 2026-08-13 06:13:33 +0900 +++ firefox-154.0/remote/test/puppeteer/test/src/launcher.spec.ts 2026-08-20 11:12:29 +0900 @@ -414,6 +414,7 @@ ); } else if (isFirefox) { expect(puppeteer.defaultArgs()).toContain('--headless'); + expect(puppeteer.defaultArgs()).toContain('--no-remote'); if (os.platform() === 'darwin') { expect(puppeteer.defaultArgs()).toContain('--foreground'); } else { @@ -481,8 +482,8 @@ const defaultArgs = puppeteer.defaultArgs(); const {browser, close} = await launch( Object.assign({}, defaultBrowserOptions, { - // All arguments are optional. - ignoreDefaultArgs: [], + // Only the first argument is fixed, others are optional. + ignoreDefaultArgs: [defaultArgs[0]!], }), ); try { @@ -490,7 +491,8 @@ if (!spawnargs) { throw new Error('spawnargs not present'); } - expect(spawnargs.indexOf(defaultArgs[0]!)).not.toBe(-1); + expect(spawnargs.indexOf(defaultArgs[0]!)).toBe(-1); + expect(spawnargs.indexOf(defaultArgs[1]!)).not.toBe(-1); } finally { await close(); } diff -urN firefox-154.0-orig/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py firefox-154.0/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py --- firefox-154.0-orig/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py 2026-08-13 06:13:35 +0900 +++ firefox-154.0/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py 2026-08-20 11:12:29 +0900 @@ -369,6 +369,7 @@ "artifact-reference": "" }, "MOZILLA_BUILD_URL": {"artifact-reference": installer}, + "MOZ_NO_REMOTE": "1", "NEED_XVFB": "false", "XPCOM_DEBUG_BREAK": "warn", "NO_FAIL_ON_TEST_ERRORS": "1", diff -urN firefox-154.0-orig/testing/marionette/client/marionette_driver/geckoinstance.py firefox-154.0/testing/marionette/client/marionette_driver/geckoinstance.py --- firefox-154.0-orig/testing/marionette/client/marionette_driver/geckoinstance.py 2026-08-13 06:13:35 +0900 +++ firefox-154.0/testing/marionette/client/marionette_driver/geckoinstance.py 2026-08-20 11:12:29 +0900 @@ -595,7 +595,7 @@ "binary": self.emulator_binary, "env": env, "profile": self.profile, - "cmdargs": ["-marionette"] + self.app_args, + "cmdargs": ["-no-remote", "-marionette"] + self.app_args, "symbols_path": self.symbols_path, "process_args": process_args, "logdir": self.workspace or os.getcwd(), diff -urN firefox-154.0-orig/testing/mochitest/runtestsremote.py firefox-154.0/testing/mochitest/runtestsremote.py --- firefox-154.0-orig/testing/mochitest/runtestsremote.py 2026-08-13 06:13:35 +0900 +++ firefox-154.0/testing/mochitest/runtestsremote.py 2026-08-20 11:12:29 +0900 @@ -374,7 +374,7 @@ profileDirectory = self.remoteProfile + "/" args = [] args.extend(extraArgs) - args.extend(("-profile", profileDirectory)) + args.extend(("-no-remote", "-profile", profileDirectory)) pid = rpm.launch( app, diff -urN firefox-154.0-orig/testing/mozbase/mozrunner/mozrunner/base/browser.py firefox-154.0/testing/mozbase/mozrunner/mozrunner/base/browser.py --- firefox-154.0-orig/testing/mozbase/mozrunner/mozrunner/base/browser.py 2026-08-13 06:13:35 +0900 +++ firefox-154.0/testing/mozbase/mozrunner/mozrunner/base/browser.py 2026-08-20 11:12:29 +0900 @@ -38,6 +38,9 @@ # its execution. self.cmdargs.append("--wait-for-browser") + # allows you to run an instance of Firefox separately from any other instances + self.env["MOZ_NO_REMOTE"] = "1" + # Disable crash reporting dialogs that interfere with debugging self.env["GNOME_DISABLE_CRASH_DIALOG"] = "1" self.env["XRE_NO_WINDOWS_CRASH_DIALOG"] = "1" diff -urN firefox-154.0-orig/testing/mozbase/rust/mozrunner/src/runner.rs firefox-154.0/testing/mozbase/rust/mozrunner/src/runner.rs --- firefox-154.0-orig/testing/mozbase/rust/mozrunner/src/runner.rs 2026-08-13 06:13:34 +0900 +++ firefox-154.0/testing/mozbase/rust/mozrunner/src/runner.rs 2026-08-20 11:12:29 +0900 @@ -166,9 +166,12 @@ /// i.e. _/Applications/Firefox.app_, as well as to an executable program /// such as _/Applications/Firefox.app/Content/MacOS/firefox_. pub fn new(path: &Path, profile: Option) -> FirefoxRunner { + let mut envs: HashMap = HashMap::new(); + envs.insert("MOZ_NO_REMOTE".into(), "1".into()); + FirefoxRunner { path: path.to_path_buf(), - envs: HashMap::new(), + envs, profile, args: vec![], stdout: None, diff -urN firefox-154.0-orig/testing/talos/talos/run_tests.py firefox-154.0/testing/talos/talos/run_tests.py --- firefox-154.0-orig/testing/talos/talos/run_tests.py 2026-08-13 06:13:36 +0900 +++ firefox-154.0/testing/talos/talos/run_tests.py 2026-08-20 11:12:29 +0900 @@ -155,6 +155,12 @@ else: browser_config["extra_args"] = [] + # pass --no-remote to firefox launch, if --develop is specified + # we do that to allow locally the user to have another running firefox + # instance + if browser_config["develop"]: + browser_config["extra_args"].append("--no-remote") + # Pass subtests filter argument via a preference if browser_config["subtests"]: browser_config["preferences"]["talos.subtests"] = browser_config["subtests"] diff -urN firefox-154.0-orig/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js firefox-154.0/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js --- firefox-154.0-orig/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js 2026-08-13 06:13:46 +0900 +++ firefox-154.0/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js 2026-08-20 11:12:29 +0900 @@ -17,7 +17,7 @@ // Test restart functionality. let exitCode = await do_backgroundtask("automaticrestart", { - extraArgs: [`-no-wait`, path, `-attach-console`], + extraArgs: [`-no-wait`, path, `-attach-console`, `-no-remote`], onStdoutLine: line => stdoutLines.push(line), }); Assert.equal(0, exitCode); diff -urN firefox-154.0-orig/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js firefox-154.0/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js --- firefox-154.0-orig/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js 2026-08-13 06:13:47 +0900 +++ firefox-154.0/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js 2026-08-20 11:12:29 +0900 @@ -4696,6 +4696,8 @@ * would otherwise pollute the xpcshell log. * * Command line arguments used when launching the application: + * -no-remote prevents shell integration from being affected by an existing + * application process. * -test-process-updates makes the application exit after being relaunched by * the updater. * the platform specific string defined by PIPE_TO_NULL to output both stdout @@ -4736,7 +4738,7 @@ scriptContents += "export XRE_PROFILE_PATH=" + profilePath + "\n"; scriptContents += appBinPath + - " -test-process-updates " + + " -no-remote -test-process-updates " + aExtraArgs.join(" ") + " " + PIPE_TO_NULL; @@ -4753,6 +4755,7 @@ appBinPath, "-profile", profilePath, + "-no-remote", "-test-process-updates", "-wait-for-browser", ] diff -urN firefox-154.0-orig/toolkit/xre/nsAppRunner.cpp firefox-154.0/toolkit/xre/nsAppRunner.cpp --- firefox-154.0-orig/toolkit/xre/nsAppRunner.cpp 2026-08-13 06:13:47 +0900 +++ firefox-154.0/toolkit/xre/nsAppRunner.cpp 2026-08-20 11:12:29 +0900 @@ -316,6 +316,7 @@ #if defined(MOZ_HAS_REMOTE) constinit static RefPtr gRemoteService; constinit static RefPtr gStartupLock; +constinit bool gRestartWithoutRemote = false; #endif int gRestartArgc; @@ -2214,6 +2215,8 @@ " --origin-to-force-quic-on \n" " Force to use QUIC for the specified origin.\n" #ifdef MOZ_HAS_REMOTE + " --no-remote Do not accept or send remote commands; implies\n" + " --new-instance.\n" " --new-instance Open new instance, not a new window in running " "instance.\n" #endif @@ -2686,6 +2689,12 @@ gRestartArgv[gRestartArgc] = nullptr; } +#if defined(MOZ_HAS_REMOTE) + if (gRestartWithoutRemote) { + SaveToEnv("MOZ_NO_REMOTE=1"); + } +#endif + SaveToEnv("MOZ_LAUNCHED_CHILD=1"); #if defined(MOZ_LAUNCHER_PROCESS) SaveToEnv("MOZ_LAUNCHER_PROCESS=1"); @@ -4123,6 +4132,7 @@ nsAutoCString mOriginToForceQUIC; #if defined(MOZ_HAS_REMOTE) bool mDisableRemoteClient = false; + bool mDisableRemoteServer = false; #endif }; @@ -4748,10 +4758,17 @@ CrashReporter::RegisterAnnotationBool(CrashReporter::Annotation::SafeMode, &gSafeMode); - // Strip the now unsupported no-remote command line argument. - CheckArg("no-remote"); - #if defined(MOZ_HAS_REMOTE) + ar = CheckArg("no-remote"); + if (ar == ARG_FOUND || EnvHasValue("MOZ_NO_REMOTE")) { + mDisableRemoteClient = true; + mDisableRemoteServer = true; + gRestartWithoutRemote = true; + // We don't want to propagate MOZ_NO_REMOTE to potential child + // process. + SaveToEnv("MOZ_NO_REMOTE="); + } + // Handle the --new-instance command line arguments. ar = CheckArg("new-instance"); if (ar == ARG_FOUND || EnvHasValue("MOZ_NEW_INSTANCE")) { @@ -4760,6 +4777,7 @@ #else // These arguments do nothing in platforms with no remoting support but we // should remove them from the command line anyway. + CheckArg("no-remote"); CheckArg("new-instance"); #endif @@ -5165,6 +5183,7 @@ #ifdef MOZ_HAS_REMOTE if (gfxPlatform::IsHeadless()) { mDisableRemoteClient = true; + mDisableRemoteServer = true; } #endif @@ -5297,9 +5316,11 @@ gRemoteService = new nsRemoteService(); if (gRemoteService) { gRemoteService->SetProgram(gAppData->remotingName); - gStartupLock = gRemoteService->LockStartup(); - if (!gStartupLock) { - NS_WARNING("Failed to lock for startup, continuing anyway."); + if (!mDisableRemoteServer) { + gStartupLock = gRemoteService->LockStartup(); + if (!gStartupLock) { + NS_WARNING("Failed to lock for startup, continuing anyway."); + } } } #endif @@ -6253,7 +6274,7 @@ #if defined(MOZ_HAS_REMOTE) // if we have X remote support, start listening for requests on the // proxy window. - if (gRemoteService) { + if (gRemoteService && !mDisableRemoteServer) { gRemoteService->StartupServer(); gStartupLock = nullptr; } @@ -6610,7 +6631,7 @@ // Shut down the remote service. We must do this before calling LaunchChild // if we're restarting because otherwise the new instance will attempt to // remote to this instance. - if (gRemoteService) { + if (gRemoteService && !mDisableRemoteServer) { gRemoteService->ShutdownServer(); gStartupLock = nullptr; gRemoteService = nullptr; diff -urN firefox-154.0-orig/toolkit/xre/test/test_launch_without_hang.js firefox-154.0/toolkit/xre/test/test_launch_without_hang.js --- firefox-154.0-orig/toolkit/xre/test/test_launch_without_hang.js 2026-08-13 06:13:47 +0900 +++ firefox-154.0/toolkit/xre/test/test_launch_without_hang.js 2026-08-20 11:12:29 +0900 @@ -238,6 +238,7 @@ let testTry = function testTry() { let shell = wrapLaunchInShell(getFirefoxExecutableFile(), [ + "-no-remote", "-test-launch-without-hang", ]); info("Try attempt #" + triesStarted);