diff -urN firefox-153.0-orig/browser/base/content/test/performance/browser_startup_mainthreadio.js firefox-153.0/browser/base/content/test/performance/browser_startup_mainthreadio.js --- firefox-153.0-orig/browser/base/content/test/performance/browser_startup_mainthreadio.js 2026-07-16 05:09:41 +0900 +++ firefox-153.0/browser/base/content/test/performance/browser_startup_mainthreadio.js 2026-07-23 14:15:21 +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-153.0-orig/browser/components/shell/test/head.js firefox-153.0/browser/components/shell/test/head.js --- firefox-153.0-orig/browser/components/shell/test/head.js 2026-07-16 05:09:41 +0900 +++ firefox-153.0/browser/components/shell/test/head.js 2026-07-23 14:15:21 +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-153.0-orig/docs/contributing/debugging/debugging_firefox_with_lldb.rst firefox-153.0/docs/contributing/debugging/debugging_firefox_with_lldb.rst --- firefox-153.0-orig/docs/contributing/debugging/debugging_firefox_with_lldb.rst 2026-07-16 05:44:59 +0900 +++ firefox-153.0/docs/contributing/debugging/debugging_firefox_with_lldb.rst 2026-07-23 14:15:21 +0900 @@ -65,7 +65,7 @@ .. code:: 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-153.0-orig/docs/contributing/debugging/debugging_on_macos.rst firefox-153.0/docs/contributing/debugging/debugging_on_macos.rst --- firefox-153.0-orig/docs/contributing/debugging/debugging_on_macos.rst 2026-07-16 05:44:59 +0900 +++ firefox-153.0/docs/contributing/debugging/debugging_on_macos.rst 2026-07-23 14:15:21 +0900 @@ -168,7 +168,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". #. 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-153.0-orig/docs/contributing/debugging/debugging_on_windows.rst firefox-153.0/docs/contributing/debugging/debugging_on_windows.rst --- firefox-153.0-orig/docs/contributing/debugging/debugging_on_windows.rst 2026-07-16 05:44:59 +0900 +++ firefox-153.0/docs/contributing/debugging/debugging_on_windows.rst 2026-07-23 14:15:21 +0900 @@ -267,7 +267,18 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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``: + +.. code:: + + 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 `__). + +You can also specify the profile to use with the ``-P profile_name`` command-line argument. Debugging JavaScript diff -urN firefox-153.0-orig/docs/performance/jit_profiling_with_perf.md firefox-153.0/docs/performance/jit_profiling_with_perf.md --- firefox-153.0-orig/docs/performance/jit_profiling_with_perf.md 2026-07-16 05:09:41 +0900 +++ firefox-153.0/docs/performance/jit_profiling_with_perf.md 2026-07-23 14:15:21 +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-153.0-orig/docs/performance/profiling_with_xperf.md firefox-153.0/docs/performance/profiling_with_xperf.md --- firefox-153.0-orig/docs/performance/profiling_with_xperf.md 2026-07-16 05:09:42 +0900 +++ firefox-153.0/docs/performance/profiling_with_xperf.md 2026-07-23 14:15:21 +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-153.0-orig/layout/tools/reftest/remotereftest.py firefox-153.0/layout/tools/reftest/remotereftest.py --- firefox-153.0-orig/layout/tools/reftest/remotereftest.py 2026-07-16 05:45:00 +0900 +++ firefox-153.0/layout/tools/reftest/remotereftest.py 2026-07-23 14:15:21 +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-153.0-orig/python/mozbuild/mozbuild/mach_commands.py firefox-153.0/python/mozbuild/mozbuild/mach_commands.py --- firefox-153.0-orig/python/mozbuild/mozbuild/mach_commands.py 2026-07-16 05:44:59 +0900 +++ firefox-153.0/python/mozbuild/mozbuild/mach_commands.py 2026-07-23 14:15:21 +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-153.0-orig/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts firefox-153.0/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts --- firefox-153.0-orig/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts 2026-07-16 05:09:49 +0900 +++ firefox-153.0/remote/test/puppeteer/packages/browsers/test/src/firefox/launch.spec.ts 2026-07-23 14:15:21 +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-153.0-orig/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts firefox-153.0/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts --- firefox-153.0-orig/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts 2026-07-16 05:09:51 +0900 +++ firefox-153.0/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.ts 2026-07-23 14:15:21 +0900 @@ -184,7 +184,7 @@ userDataDir = null, } = options; - const firefoxArguments = []; + const firefoxArguments = ['--no-remote']; switch (os.platform()) { case 'darwin': diff -urN firefox-153.0-orig/remote/test/puppeteer/test/src/launcher.spec.ts firefox-153.0/remote/test/puppeteer/test/src/launcher.spec.ts --- firefox-153.0-orig/remote/test/puppeteer/test/src/launcher.spec.ts 2026-07-16 05:09:49 +0900 +++ firefox-153.0/remote/test/puppeteer/test/src/launcher.spec.ts 2026-07-23 14:15:21 +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-153.0-orig/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py firefox-153.0/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py --- firefox-153.0-orig/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py 2026-07-16 05:09:51 +0900 +++ firefox-153.0/taskcluster/gecko_taskgraph/transforms/job/mozharness_test.py 2026-07-23 14:15:21 +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-153.0-orig/testing/marionette/client/marionette_driver/geckoinstance.py firefox-153.0/testing/marionette/client/marionette_driver/geckoinstance.py --- firefox-153.0-orig/testing/marionette/client/marionette_driver/geckoinstance.py 2026-07-16 05:45:00 +0900 +++ firefox-153.0/testing/marionette/client/marionette_driver/geckoinstance.py 2026-07-23 14:15:21 +0900 @@ -592,7 +592,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-153.0-orig/testing/mochitest/runtestsremote.py firefox-153.0/testing/mochitest/runtestsremote.py --- firefox-153.0-orig/testing/mochitest/runtestsremote.py 2026-07-16 05:45:00 +0900 +++ firefox-153.0/testing/mochitest/runtestsremote.py 2026-07-23 14:15:21 +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-153.0-orig/testing/mozbase/mozrunner/mozrunner/base/browser.py firefox-153.0/testing/mozbase/mozrunner/mozrunner/base/browser.py --- firefox-153.0-orig/testing/mozbase/mozrunner/mozrunner/base/browser.py 2026-07-16 05:09:51 +0900 +++ firefox-153.0/testing/mozbase/mozrunner/mozrunner/base/browser.py 2026-07-23 14:15:21 +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-153.0-orig/testing/mozbase/rust/mozrunner/src/runner.rs firefox-153.0/testing/mozbase/rust/mozrunner/src/runner.rs --- firefox-153.0-orig/testing/mozbase/rust/mozrunner/src/runner.rs 2026-07-16 05:45:00 +0900 +++ firefox-153.0/testing/mozbase/rust/mozrunner/src/runner.rs 2026-07-23 14:15:21 +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-153.0-orig/testing/talos/talos/run_tests.py firefox-153.0/testing/talos/talos/run_tests.py --- firefox-153.0-orig/testing/talos/talos/run_tests.py 2026-07-16 05:09:52 +0900 +++ firefox-153.0/testing/talos/talos/run_tests.py 2026-07-23 14:15:21 +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-153.0-orig/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js firefox-153.0/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js --- firefox-153.0-orig/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js 2026-07-16 05:10:01 +0900 +++ firefox-153.0/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_automaticrestart.js 2026-07-23 14:15:21 +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-153.0-orig/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js firefox-153.0/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js --- firefox-153.0-orig/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js 2026-07-16 05:10:03 +0900 +++ firefox-153.0/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js 2026-07-23 14:15:21 +0900 @@ -4687,6 +4687,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 @@ -4727,7 +4729,7 @@ scriptContents += "export XRE_PROFILE_PATH=" + profilePath + "\n"; scriptContents += appBinPath + - " -test-process-updates " + + " -no-remote -test-process-updates " + aExtraArgs.join(" ") + " " + PIPE_TO_NULL; @@ -4744,6 +4746,7 @@ appBinPath, "-profile", profilePath, + "-no-remote", "-test-process-updates", "-wait-for-browser", ] diff -urN firefox-153.0-orig/toolkit/xre/nsAppRunner.cpp firefox-153.0/toolkit/xre/nsAppRunner.cpp --- firefox-153.0-orig/toolkit/xre/nsAppRunner.cpp 2026-07-16 05:45:00 +0900 +++ firefox-153.0/toolkit/xre/nsAppRunner.cpp 2026-07-23 14:15:21 +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; @@ -2202,6 +2203,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 @@ -2674,6 +2677,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"); @@ -4111,6 +4120,7 @@ nsAutoCString mOriginToForceQUIC; #if defined(MOZ_HAS_REMOTE) bool mDisableRemoteClient = false; + bool mDisableRemoteServer = false; #endif }; @@ -4736,10 +4746,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")) { @@ -4748,6 +4765,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 @@ -5143,6 +5161,7 @@ #ifdef MOZ_HAS_REMOTE if (gfxPlatform::IsHeadless()) { mDisableRemoteClient = true; + mDisableRemoteServer = true; } #endif @@ -5275,9 +5294,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 @@ -6229,7 +6250,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; } @@ -6586,7 +6607,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-153.0-orig/toolkit/xre/test/test_launch_without_hang.js firefox-153.0/toolkit/xre/test/test_launch_without_hang.js --- firefox-153.0-orig/toolkit/xre/test/test_launch_without_hang.js 2026-07-16 05:10:01 +0900 +++ firefox-153.0/toolkit/xre/test/test_launch_without_hang.js 2026-07-23 14:15:21 +0900 @@ -238,6 +238,7 @@ let testTry = function testTry() { let shell = wrapLaunchInShell(getFirefoxExecutableFile(), [ + "-no-remote", "-test-launch-without-hang", ]); info("Try attempt #" + triesStarted);