jackwener / jackwener/OpenCLI

[Feature] Auto-launch Chrome when Browser Bridge extension is not connected

Open
#1,075 3 comments 0 reactions 0 assignees View on GitHub

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 doctor and Chrome auto-restart crontab setups
  • BROWSER_CONNECT is the top user friction point in WSL environments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.