Skip to content

Commit 5447e59

Browse files
committed
fix(windows): work around Chrome not reporting reasons for crash
1 parent bfbdada commit 5447e59

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
@@ -83,11 +83,7 @@ export async function launch(options: McpLaunchOptions): Promise<Browser> {
8383
});
8484
}
8585

86-
const args: LaunchOptions['args'] = [
87-
'--remote-debugging-pipe',
88-
'--no-first-run',
89-
'--hide-crash-restore-bubble',
90-
];
86+
const args: LaunchOptions['args'] = ['--hide-crash-restore-bubble'];
9187
if (customDevTools) {
9288
args.push(`--custom-devtools-frontend=file://${customDevTools}`);
9389
}
@@ -111,11 +107,11 @@ export async function launch(options: McpLaunchOptions): Promise<Browser> {
111107
args,
112108
});
113109
} catch (error) {
114-
// TODO: check browser logs for `Failed to create a ProcessSingleton for
115-
// your profile directory` instead.
116110
if (
117111
userDataDir &&
118-
(error as Error).message.includes('The browser is already running')
112+
((error as Error).message.includes('The browser is already running') ||
113+
(error as Error).message.includes('Target closed') ||
114+
(error as Error).message.includes('Connection closed'))
119115
) {
120116
throw new Error(
121117
`The browser is already running for ${userDataDir}. Use --isolated to run multiple browser instances.`,

0 commit comments

Comments
 (0)