Skip to content

Restrict local browser selection by family#487

Open
simi2525 wants to merge 5 commits into
browser-use:mainfrom
simi2525:codex/chrome-only-browser-family
Open

Restrict local browser selection by family#487
simi2525 wants to merge 5 commits into
browser-use:mainfrom
simi2525:codex/chrome-only-browser-family

Conversation

@simi2525

@simi2525 simi2525 commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • add BH_BROWSER_FAMILY filtering for local profile discovery, inspect-page launching, and dedicated browser executable selection
  • skip anonymous CDP port probes when a strict browser family is selected, so Chrome-only mode cannot attach to Brave/Edge by accident
  • document the Chrome-only local setup and add regression coverage for Brave profiles/processes being ignored

Validation

  • uv run --with pytest python -m pytest tests\unit
  • uv run browser-harness --doctor
  • Manual browser-control validation on Windows with local .env set to BH_BROWSER_FAMILY=chrome: restarted the daemon, ran browser-harness, confirmed the daemon tried the Google Chrome default profile first, then fell back to a dedicated Google Chrome profile when the default-profile websocket handshake was blocked. Process inspection showed the CDP endpoint on port 9223 belonged to C:\Program Files\Google\Chrome\Application\chrome.exe, not Brave.

Browser Evidence

This change affects the local browser-control harness rather than an app UI. The relevant manual evidence is the daemon/process validation above; no reviewer-facing app screenshot or recording applies.


Summary by cubic

Adds browser family filtering and a smarter local startup that reuses your signed‑in Chrome profile when available, then falls back to a dedicated automation browser without getting stuck on permission prompts. Also fixes Windows inspect-page opening and avoids attaching to Brave/Edge in Chrome-only mode.

  • New Features

    • BH_BROWSER_FAMILY restricts discovery, process/binary selection, and inspect-page opening, and validates CDP endpoints by browser product so dedicated/reused endpoints match the selected family.
    • BH_LOCAL_BROWSER_MODE: auto (default) briefly tries the default profile via DevToolsActivePort, then falls back to a dedicated browser if blocked; default and dedicated are also supported. Added BH_DEDICATED_CHROME_PORT and BH_DEDICATED_CHROME_USER_DATA_DIR.
    • Tunable timeouts: BH_CDP_OPEN_TIMEOUT_SECONDS (longer default for local, shorter for explicit remote) and BH_DEFAULT_PROFILE_PROBE_TIMEOUT_SECONDS for the quick default-profile WS probe.
  • Bug Fixes

    • Skip blind CDP port probes when a family is set to prevent accidental Brave/Edge attachment in Chrome-only mode.
    • Windows: open chrome://inspect/#remote-debugging using the real browser binary (not the shell handler) and add a per-daemon cooldown to avoid repeated prompts.

Written for commit a5fcc01. Summary will update on new commits.

Review in cubic

@browser-harness-review

Copy link
Copy Markdown

✅ Skill review passed

Reviewed 1 file(s) — no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 7 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/browser_harness/daemon.py
Comment thread src/browser_harness/browser_family.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant