Skip to content

Commit d545741

Browse files
authored
fix(windows): work around Chrome not reporting reasons for crash (#64)
1 parent 85a6d64 commit d545741

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/browser.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ export async function launch(options: McpLaunchOptions): Promise<Browser> {
8484
});
8585
}
8686

87-
const args: LaunchOptions['args'] = [
88-
'--remote-debugging-pipe',
89-
'--no-first-run',
90-
'--hide-crash-restore-bubble',
91-
];
87+
const args: LaunchOptions['args'] = ['--hide-crash-restore-bubble'];
9288
if (customDevTools) {
9389
args.push(`--custom-devtools-frontend=file://${customDevTools}`);
9490
}
@@ -119,11 +115,11 @@ export async function launch(options: McpLaunchOptions): Promise<Browser> {
119115
}
120116
return browser;
121117
} catch (error) {
122-
// TODO: check browser logs for `Failed to create a ProcessSingleton for
123-
// your profile directory` instead.
124118
if (
125119
userDataDir &&
126-
(error as Error).message.includes('The browser is already running')
120+
((error as Error).message.includes('The browser is already running') ||
121+
(error as Error).message.includes('Target closed') ||
122+
(error as Error).message.includes('Connection closed'))
127123
) {
128124
throw new Error(
129125
`The browser is already running for ${userDataDir}. Use --isolated to run multiple browser instances.`,

0 commit comments

Comments
 (0)