From 36ed5a9a5844c2d78bb8b436bbd77150df473880 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Mon, 22 Sep 2025 16:02:12 +0200 Subject: [PATCH] fix(windows): work around Chrome not reporting reasons for crash --- src/browser.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/browser.ts b/src/browser.ts index eb1f173f..2e1cb3ba 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -84,11 +84,7 @@ export async function launch(options: McpLaunchOptions): Promise { }); } - const args: LaunchOptions['args'] = [ - '--remote-debugging-pipe', - '--no-first-run', - '--hide-crash-restore-bubble', - ]; + const args: LaunchOptions['args'] = ['--hide-crash-restore-bubble']; if (customDevTools) { args.push(`--custom-devtools-frontend=file://${customDevTools}`); } @@ -119,11 +115,11 @@ export async function launch(options: McpLaunchOptions): Promise { } return browser; } catch (error) { - // TODO: check browser logs for `Failed to create a ProcessSingleton for - // your profile directory` instead. if ( userDataDir && - (error as Error).message.includes('The browser is already running') + ((error as Error).message.includes('The browser is already running') || + (error as Error).message.includes('Target closed') || + (error as Error).message.includes('Connection closed')) ) { throw new Error( `The browser is already running for ${userDataDir}. Use --isolated to run multiple browser instances.`,