[Feature] Auto-launch Chrome when Browser Bridge extension is not connected
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29.5k
- Forks
- 2.9k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 70
Description
Feature Request: Auto-launch Chrome when Browser Bridge extension is not connected
Problem
When the Chrome extension (Browser Bridge) is not connected, opencli immediately throws a BROWSER_CONNECT error with no recovery attempt:
ok: false
error:
code: BROWSER_CONNECT
message: Browser Bridge extension not connected
This creates a poor UX — users must manually start Chrome, verify the extension is loaded, then retry the command.
Proposed Solution
Before throwing BROWSER_CONNECT, opencli should proactively attempt to start Chrome and wait briefly for the extension to connect, similar to the self-healing logic already present in some CLI wrappers.
Pseudo-code (~5 lines):
if (error.code === "BROWSER_CONNECT") {
console.warn("Chrome not connected, attempting to start...");
spawn("google-chrome", [...args]); // or appropriate platform command
await sleep(2000); // wait for extension to init
// retry once, then fail with original error if still failing
}
Why this helps
- New users: Get a running experience instead of a cryptic error
- WSL/Linux users: Chrome often needs manual
export DISPLAY=:0+ launch - Recoverable: Only adds ~2s delay on failure; transparent to already-connected users
References
- Similar pattern in
opencli doctorand Chrome auto-restart crontab setups BROWSER_CONNECTis the top user friction point in WSL environments
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the CLI path that reports the BROWSER_CONNECT error and review the existing recovery behavior referenced in opencli doctor. Add a Chrome launch and brief connection retry only for this error, preserving the original failure when the extension remains disconnected; verify the already-connected path is unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100