Skip to content

feat(firefox): network control and emulation on Firefox - #2207

Open
lahfir wants to merge 77 commits into
laf/bidi-snapshot-refs-inputfrom
laf/bidi-network-emulation
Open

lahfir wants to merge 77 commits into
laf/bidi-snapshot-refs-inputfrom
laf/bidi-network-emulation

Conversation

@lahfir

@lahfir lahfir commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
  1. Firefox sessions had no request routing, domain allowlist, HAR, downloads or device emulation.
  2. This adds network control and emulation on Firefox through one BiDi intercept, matching the Chrome commands and output.
  3. Builds on feat(firefox): snapshots, refs and element commands on Firefox #2206; continued in feat(firefox): dashboard live view, bidi module and docs #2208.

@vercel

vercel Bot commented Oct 23, 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 11, 2026 3:57am UTC
agent-browser-env-demo Ready Ready Preview, v0 Nov 11, 2026 3:57am UTC

@vercel-internal-security-reviewer

Copy link
Copy Markdown

Security review details

Comment thread cli/src/native/firefox/session.rs Resolved
The launch path opened a second RDP connection and enabled accessibility again, left over from a merge. Drop the duplicate block.
Destroyed-tab handling now lives in FirefoxSession::track_tabs, called from drain_events. network::drain resets ref and frame state when the active tab changes.
The 90 second RDP timeout only hid the hang caused by the duplicate DevTools connection, which is fixed. Go back to 30 seconds so a real hang still fails fast.
Comment thread cli/src/native/firefox/page.rs Resolved
Comment thread cli/src/native/firefox/network.rs Resolved
Comment thread cli/src/output.rs Resolved
…jected

Update --help and the command references to describe proxy credentials as supported and keep the rejected list accurate.
Comment thread cli/src/native/firefox/emulation.rs Resolved
Comment thread .github/workflows/ci.yml Resolved

@Railly Railly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 to ctate's notes, will follow the rest

Moves network and emulation onto the context registry: request
ownership, active-tab filtering and download waits ask it which tab a
context belongs to, and unfinished requests are dropped with the
contexts that owned them.

Adds Firefox e2e coverage for handlers that had none: origin-scoped
headers, request detail, response bodies, HAR, console and page errors,
route and unroute, offline, runtime user agent, locale, geolocation and
permissions. Each test was checked to fail when its handler is broken.
Comment thread cli/src/native/firefox/bidi.rs Resolved
A subscriber's queue holds 65,536 events and anything past that was
dropped without a trace. The session drains its queue only when a
command runs, so on a busy page a dropped `network.responseCompleted`
left its request counted as unfinished for the life of the tab and
later `networkidle` waits timed out.

The client now records that it dropped events. The session checks that
before each command and, after a drop, reads the context tree again and
forgets the unfinished requests, since their completions may be among
what was lost. This is the same recovery that already ran when no
context was active, now one function.
.rev()
.find(|e| e.request_id == id)
{
entry.post_data = Some(body.clone());

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.

The HAR path stores the body even when it is empty, unlike the tracked-request path below it, so a bodyless request records postData with "text": "" in the HAR while Chrome emits no postData block. Reproduced.

This branch was successfully deployed

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

3 participants