Firefox parity Phase 3 — ad/tracker block + JS dialogs (BiDi) [v0.18.0]#7
Merged
Conversation
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
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.
Firefox/BiDi parity Phase 3
Brings the Firefox engine to parity with Chromium/CDP on two more capabilities.
Ad/tracker blocking (
blockAdsdefault on;blockUrlsextends)BiDi's
network.addInterceptcan't express our globs (urlPatternsreject*, no subdomain wildcard — POC-measured), so the FF path registers a catch-allbeforeRequestSentintercept and matches each URL in-process against the shared blocklist. Matches →failRequest(like CDPERR_BLOCKED_BY_CLIENT); the rest →continueRequest.src/blocklist-firefox.js.JS dialog handling
Session created with
unhandledPromptBehavior:'ignore'so Firefox stops auto-dismissing beforehandleUserPromptcan act (the "no such alert" race, POC-measured). Realpage.dialogLog+page.onDialog(handler)mirror the CDP surface (accept all exceptbeforeunload;promptreturnsdefaultValue).Review fixes folded in
makeBlockMatchernow supports CDP's?one-char wildcard (not just*).resolveBlocklistPatternssingle-sources theblockAds/blockUrlsmerge across both engines.Verification
tsc --noEmitexit 0.blocklist-firefox) + 4 Firefox integration (ad-block via a hermetic CORS server so theblockAds:falsecontrol genuinely passes through; dialog auto-accept +dialogLog+ customonDialog).🤖 Generated with Claude Code
https://claude.ai/code/session_01MZpPPhwXmSfN1n7uX7RAxT