Bug description
Fetch.enable with a patterns array of urlPatterns is translated to Juggler's Browser.setRequestInterception with only {enabled: true} — the URL patterns are dropped entirely. As a result, every request in the browser is intercepted (paused) instead of only the requests matching the requested patterns.
Root cause
In pkg/bridge/fetch.go, the Fetch.enable handler parses params.Patterns but never uses it; it only forwards {"enabled": true} to Juggler. Juggler has no pattern support of its own, so the bridge must implement the pattern filtering — but it currently doesn't, and the Browser.requestIntercepted → Fetch.requestPaused handler in pkg/bridge/events.go emits a paused event for every intercepted request.
Impact
Any client that scopes Fetch.enable to a single URL (e.g. a dialog-bridge supervisor intercepting only http://hermes-dialog-bridge.invalid/*) gets all navigation requests paused forever:
Page.navigate returns a navigationId, but the page never commits — no frameNavigated is ever emitted.
- Every request waits for a
Fetch.continueRequest that the client will never send (it only handles requests matching its pattern).
- Navigation stalls indefinitely; the only way out is disabling interception entirely.
Repro steps
- Start foxbridge and connect a CDP client (e.g. Puppeteer) to a Firefox/Camoufox instance.
- Call
Fetch.enable with a single pattern, e.g. {"patterns": [{"urlPattern": "http://hermes-dialog-bridge.invalid/*"}]}.
- Call
Page.navigate to any other URL (e.g. https://example.com).
- Observe: the navigation request is paused and
Fetch.requestPaused is emitted for it (matching the pattern or not), Page.navigate returns a navigationId, but frameNavigated never fires and the page never loads.
Expected vs actual
- Expected (Chrome semantics): only requests matching at least one
urlPattern are paused; all other requests are transparently continued.
- Actual: every request is paused and waits for a continuation that never comes.
Fix approach
- Keep the per-CDP-session
urlPattern list from Fetch.enable (and clear it on Fetch.disable).
- In the
Browser.requestIntercepted handler, auto-continue (Browser.continueInterceptedRequest) any request whose URL matches no pattern, and only emit Network.requestWillBeSent / Fetch.requestPaused for matching requests.
- Pattern matching mirrors Chrome: glob where
* matches any sequence, case-insensitive, anchored to the full URL.
Fetch.enable with no patterns keeps the current behavior (intercept everything).
Bug description
Fetch.enablewith apatternsarray ofurlPatterns is translated to Juggler'sBrowser.setRequestInterceptionwith only{enabled: true}— the URL patterns are dropped entirely. As a result, every request in the browser is intercepted (paused) instead of only the requests matching the requested patterns.Root cause
In
pkg/bridge/fetch.go, theFetch.enablehandler parsesparams.Patternsbut never uses it; it only forwards{"enabled": true}to Juggler. Juggler has no pattern support of its own, so the bridge must implement the pattern filtering — but it currently doesn't, and theBrowser.requestIntercepted→Fetch.requestPausedhandler inpkg/bridge/events.goemits a paused event for every intercepted request.Impact
Any client that scopes
Fetch.enableto a single URL (e.g. a dialog-bridge supervisor intercepting onlyhttp://hermes-dialog-bridge.invalid/*) gets all navigation requests paused forever:Page.navigatereturns anavigationId, but the page never commits — noframeNavigatedis ever emitted.Fetch.continueRequestthat the client will never send (it only handles requests matching its pattern).Repro steps
Fetch.enablewith a single pattern, e.g.{"patterns": [{"urlPattern": "http://hermes-dialog-bridge.invalid/*"}]}.Page.navigateto any other URL (e.g.https://example.com).Fetch.requestPausedis emitted for it (matching the pattern or not),Page.navigatereturns anavigationId, butframeNavigatednever fires and the page never loads.Expected vs actual
urlPatternare paused; all other requests are transparently continued.Fix approach
urlPatternlist fromFetch.enable(and clear it onFetch.disable).Browser.requestInterceptedhandler, auto-continue (Browser.continueInterceptedRequest) any request whose URL matches no pattern, and only emitNetwork.requestWillBeSent/Fetch.requestPausedfor matching requests.*matches any sequence, case-insensitive, anchored to the full URL.Fetch.enablewith no patterns keeps the current behavior (intercept everything).