fix: Chrome requires --user-data-dir for remote debugging

Chrome refuses --remote-debugging-port without an explicit --user-data-dir.
Add userDataDir to BrowserBinary registry (macOS Application Support paths)
and pass it in both auto-launch and manual restart instructions.

Fix double-quoting in CLI manual restart instructions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-21 12:24:03 -07:00
parent f62377748b
commit 65cc48c885
2 changed files with 15 additions and 10 deletions
+2 -2
View File
@@ -389,10 +389,10 @@ Refs: After 'snapshot', use @e1, @e2... as selectors:
console.log(`To connect, quit ${result.browser.name} and restart it with CDP enabled:\n`);
console.log(` 1. Quit ${result.browser.name} (Cmd+Q)`);
console.log(` 2. Open Terminal and run:`);
console.log(` "${result.command}"`);
console.log(` ${result.command}`);
console.log(` 3. Then run: $B connect ${result.browser.name.toLowerCase()}\n`);
console.log(`Or add this to your shell profile to always launch with CDP:`);
console.log(` alias chrome-cdp='"${result.command}"'\n`);
console.log(` alias chrome-cdp='${result.command}'\n`);
// Wait and poll — user might restart Chrome while we're printing
console.log(`Waiting for CDP on port ${result.port}...`);