From 5c7058bb47913151c2e810f66b50c960fdb5d853 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 30 Jun 2026 11:08:28 +0200 Subject: [PATCH] fix: apply MacControlledWindowBehavior flag to handoff() path on macOS 26 The --disable-features=MacControlledWindowBehavior flag added to launchHeaded() was missing from the handoff() code path (headless -> headed re-launch). The handoff() method builds its own launchArgs array independently, so macOS 26 users who trigger a headless-to-headed handoff would still see the window-close bug even after the launchHeaded() fix. Apply the same darwin guard to the handoff() launchArgs so all headed launch paths suppress the new OS-level window-hiding behavior on Sequoia. --- browse/src/browser-manager.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/browse/src/browser-manager.ts b/browse/src/browser-manager.ts index 4ff608c36..443e9698d 100644 --- a/browse/src/browser-manager.ts +++ b/browse/src/browser-manager.ts @@ -1569,6 +1569,13 @@ export class BrowserManager { // STEALTH_LAUNCH_ARGS the handed-off browser kept the AutomationControlled // tell that the other two paths strip. const launchArgs: string[] = ['--hide-crash-restore-bubble', ...STEALTH_LAUNCH_ARGS, ...buildGStackLaunchArgs()]; + // macOS 26: same window-hiding suppression as launchHeaded(). The handoff + // path launches a fresh headed Chromium and is subject to the same + // MacControlledWindowBehavior that causes the window to close immediately + // on Sequoia. No-op on macOS < 26 and on non-macOS platforms. + if (process.platform === 'darwin') { + launchArgs.push('--disable-features=MacControlledWindowBehavior'); + } if (extensionPath) { launchArgs.push(`--disable-extensions-except=${extensionPath}`); launchArgs.push(`--load-extension=${extensionPath}`);