Skip to content

Commit 9e7b36a

Browse files
committed
Fix: handle empty --browserUrl to prevent Invalid URL crash
1 parent 1e50619 commit 9e7b36a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cli.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ export const cliOptions = {
1414
'Connect to a running Chrome instance using port forwarding. For more details see: https://developer.chrome.com/docs/devtools/remote-debugging/local-server.',
1515
alias: 'u',
1616
coerce: (url: string) => {
17-
new URL(url);
18-
return url;
17+
if (!url || url.trim() === '') {
18+
return undefined;
19+
}
20+
return new URL(url).toString();
1921
},
2022
},
2123
headless: {

0 commit comments

Comments
 (0)