Skip to content

feat(firefox): attach to a running Firefox over WebDriver BiDi - #2227

Open
lahfir wants to merge 91 commits into
laf/bidi-live-view-docsfrom
laf/bidi-attach
Open

lahfir wants to merge 91 commits into
laf/bidi-live-view-docsfrom
laf/bidi-attach

Conversation

@lahfir

@lahfir lahfir commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
  1. connect and --cdp only spoke CDP, so agent-browser could not attach to a Firefox that was already running.
  2. They now detect a Firefox WebDriver BiDi endpoint and attach to it, using Firefox's DevTools server for snapshots and refs.
  3. Builds on feat(firefox): dashboard live view, bidi module and docs #2208. Fixes Firefox WebDriver BiDi attach support (connect works at network level, protocol is Chrome-CDP only) #2115.
firefox-attach.mp4

@lahfir
lahfir added this pull request to stack #2209 October 26, 2026 22:52
@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agent-browser Ready Ready Preview, v0 Nov 9, 2026 10:48pm UTC
agent-browser-env-demo Ready Ready Preview, v0 Nov 9, 2026 10:48pm UTC

@vercel-internal-security-reviewer

Copy link
Copy Markdown

Security review details

Comment thread cli/src/native/bidi/attach.rs Resolved
Comment thread cli/src/native/actions.rs Resolved
Comment thread cli/src/native/actions.rs Resolved
Use owner_tab for destroyed-tab cleanup and match the restored option validation test to the attach-aware signature.
Comment thread cli/src/native/bidi/firefox_devtools.rs Resolved
Comment thread cli/src/native/actions.rs Resolved
Comment thread cli/src/native/bidi/session.rs Resolved
.to_string(),
);
}
let context = contexts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Attach adopts the first browsingContext.getTree tab and never checks which tab is selected, so with several tabs open commands act on the oldest tab and the first snapshot activates it in the user's window. Reproduced.

continue;
}
let external_firefox = key == Key::Engine && value.as_str() == Some("firefox");
let external_firefox = key == Key::Engine

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Only Engine is exempted from the local-only rule, so --user-agent is ignored on an attached Firefox: agent-browser --user-agent X open ... after connect leaves Firefox's own UA unchanged, though the attach docs say it applies. Reproduced.

This branch was successfully deployed

2 active deployments
Preview – agent-browser-env-demo — a02abab4 Deployed Nov 9, 2026 by vercel[bot]
Preview – agent-browser — a02abab4 Deployed Nov 9, 2026 by vercel[bot]
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.

Firefox WebDriver BiDi attach support (connect works at network level, protocol is Chrome-CDP only)

2 participants