Skip to content

Firefox parity Phase 3 — ad/tracker block + JS dialogs (BiDi) [v0.18.0]#7

Merged
hamr0 merged 2 commits into
mainfrom
feat/firefox-parity-phase3
Jul 11, 2026
Merged

Firefox parity Phase 3 — ad/tracker block + JS dialogs (BiDi) [v0.18.0]#7
hamr0 merged 2 commits into
mainfrom
feat/firefox-parity-phase3

Conversation

@hamr0

@hamr0 hamr0 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Firefox/BiDi parity Phase 3

Brings the Firefox engine to parity with Chromium/CDP on two more capabilities.

Ad/tracker blocking (blockAds default on; blockUrls extends)

BiDi's network.addIntercept can't express our globs (urlPatterns reject *, no subdomain wildcard — POC-measured), so the FF path registers a catch-all beforeRequestSent intercept and matches each URL in-process against the shared blocklist. Matches → failRequest (like CDP ERR_BLOCKED_BY_CLIENT); the rest → continueRequest. src/blocklist-firefox.js.

JS dialog handling

Session created with unhandledPromptBehavior:'ignore' so Firefox stops auto-dismissing before handleUserPrompt can act (the "no such alert" race, POC-measured). Real page.dialogLog + page.onDialog(handler) mirror the CDP surface (accept all except beforeunload; prompt returns defaultValue).

Review fixes folded in

  • makeBlockMatcher now supports CDP's ? one-char wildcard (not just *).
  • resolveBlocklistPatterns single-sources the blockAds/blockUrls merge across both engines.
  • 3 review findings recorded as accepted known-limitations in the PRD (per-request intercept cost; latent missing-id suspension; dialog-handler coupling + CDP↔BiDi decision duplication).

Verification

  • Full suite 242/242, tsc --noEmit exit 0.
  • +12 unit (blocklist-firefox) + 4 Firefox integration (ad-block via a hermetic CORS server so the blockAds:false control genuinely passes through; dialog auto-accept + dialogLog + custom onDialog).
  • CDP ad-block integration 3/3 (refactor regression check); FF ad-block + dialogs live-verified against real sites (theverge.com trackers blocked, example.com dialogs handled).
  • BiDi event shapes POC-measured against real Firefox before wiring.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MZpPPhwXmSfN1n7uX7RAxT

hamr0 and others added 2 commits July 11, 2026 09:28
Bring the Firefox/BiDi engine to parity with Chromium/CDP on two more
capabilities (parity plan Phase 3):

- Ad/tracker blocking (blockAds default on; blockUrls extends). BiDi's
  network.addIntercept can't express our globs, so register a catch-all
  beforeRequestSent intercept and match each URL in-process against the
  shared blocklist (new makeBlockMatcher, CDP glob semantics incl. '?').
  src/blocklist-firefox.js.
- JS dialogs: session created with unhandledPromptBehavior:'ignore' so
  Firefox stops auto-dismissing before handleUserPrompt can act; real
  page.dialogLog + page.onDialog mirror the CDP surface.

Review fixes folded in: makeBlockMatcher supports CDP's '?' one-char
wildcard; resolveBlocklistPatterns single-sources the blockAds/blockUrls
merge across both engines. Three review findings recorded as accepted
known-limitations in the PRD.

Tests: +12 unit (blocklist-firefox) + 4 Firefox integration; full suite
242/242, tsc --noEmit exit 0. POC-measured BiDi event shapes first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MZpPPhwXmSfN1n7uX7RAxT
…ogs)

Version bump + docs for the Phase 3 feature commit. Dates CHANGELOG
[0.18.0], version-stamps the parity plan (Phase 2 → v0.17.0, Phase 3 →
v0.18.0), and corrects the README Firefox capability list (console/network
capture shipped in v0.17.0; ad-block + dialogs in v0.18.0; only hybrid mode
remains Chromium-only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MZpPPhwXmSfN1n7uX7RAxT
@hamr0
hamr0 merged commit bad8281 into main Jul 11, 2026
1 check passed
@hamr0
hamr0 deleted the feat/firefox-parity-phase3 branch July 11, 2026 07:35
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