examples: browser-use connects too — verified, and a stale README claim fixed - #9
Merged
Merged
Conversation
The main README asserted "browser-use is Playwright-based, so it connects to the bridge unchanged" — true when written, false for current browser-use releases (they ship their own CDP client, cdp_use, not Playwright), and never actually tested either way. examples/browser-use/ is the real test: a Node companion (bridge_server.mjs) starts a bridge + login site, and a Python script (test_login.py) connects browser-use directly to the bridge's ws:// URL and drives the same login-fill proof register-login-act.mjs already does for Puppeteer/ Playwright — browser-use's own tab never touches the password field, the fill happens on a throwaway target, and the agent's tab is authenticated afterward with the password appearing nowhere it can read. Confirmed along the way: - browser-use's connect() skips its usual /json/version HTTP discovery whenever cdp_url already starts with "ws", so no special-casing was needed on either side to hand it the bridge's URL directly. - browser-use calls Browser.grantPermissions on connect, which Puppeteer/ Playwright don't; the gate correctly refuses it (not on the allowlist) without breaking the session. - browser-use's own get_tabs()/tab.url cache can read stale right after navigate_to() even though the page really navigated — a browser-use-side quirk (confirmed by reading location.href directly), not a bridge one. Updates both READMEs' framework-compatibility claims to point at this and be accurate about what changed in browser-use itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/browser-use/— an end-to-end proof that browser-use (a real third-party Python agentic browser framework, not built on Puppeteer or Playwright) connects to the bridge's CDP proxy and preserves the credential-fill guarantee, mirroring whatregister-login-act.mjsalready proves for Puppeteer. Two processes:bridge_server.mjs(Node) starts a real bridge + login site;test_login.py(Python) connects browser-use and drives the whole flow.cdp_use, not Playwright) — and this was never actually tested either way. Both READMEs now point at the real example and describe what's actually true.What the new example confirms
connect()treatscdp_urlas an HTTP endpoint to run/json/versiondiscovery against — a discovery step browser-bridge doesn't serve (plain HTTP is a flat 404 by design). But browser-use's own code skips that discovery entirely whenever the URL already starts withws, so pointing it straight at the bridge's printed URL just works — the same shape asbrowserWSEndpoint/connectOverCDP.Browser.grantPermissionson connect (Puppeteer/Playwright don't); the gate correctly refuses it (method_not_allowed, not on the allowlist) and browser-use handles the refusal without breaking the session.One browser-use-side quirk noted in the README, not worked around since it doesn't affect the result: right after
navigate_to(), browser-use's ownget_tabs()/tab.urlcache can still readabout:blankeven though the page really navigated (confirmed via a directlocation.hrefread through browser-use's own CDP session).Test plan
examples/browser-use/test_login.pyagainst a real headless Chromium, 4 clean passes (exit 0, no password leak, login genuinely authenticated)pnpm verify(typecheck + typecheck:tests + full suite) — 276 passed, 6 skipped, no regressionsnode --checkon the new.mjsfile🤖 Generated with Claude Code
https://claude.ai/code/session_01WqPU5z6K3maS9J6LrcsEic