diff --git a/src/browser.ts b/src/browser.ts index 76fd14f42..003df1684 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -120,6 +120,7 @@ export async function launch(options: McpLaunchOptions): Promise { userDataDir, pipe: true, headless, + dumpio: true, args, acceptInsecureCerts: options.acceptInsecureCerts, handleDevToolsAsPage: options.devtools, @@ -142,9 +143,7 @@ export async function launch(options: McpLaunchOptions): Promise { } catch (error) { if ( userDataDir && - ((error as Error).message.includes('The browser is already running') || - (error as Error).message.includes('Target closed') || - (error as Error).message.includes('Connection closed')) + (error as Error).message.includes('The browser is already running') ) { throw new Error( `The browser is already running for ${userDataDir}. Use --isolated to run multiple browser instances.`,