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.
This commit is contained in:
Chris 2026-06-30 11:08:28 +02:00
parent c0a9f4cb19
commit 5c7058bb47
1 changed files with 7 additions and 0 deletions

View File

@ -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}`);