Instantiate a WebDriver with BiDi enabled: options = ChromeOptions(); driver = webdriver.Chrome(options=options)
Access the BiDi network module: async with driver.bidi_connection() as conn: network = Network(conn.session)
Add an intercept for a URL pattern and phase: await network.add_intercept(phases=[InterceptPhase.BEFORE_REQUEST], url_patterns=[UrlPattern.string('https://api.example.com/*')])
Subscribe to the before_request_sent event and call await network.continue_request(request_id=event.request_id, headers=[Header(name='X-Test', value='1')]) to inject headers
To block a request, call await network.fail_request(request_id=event.request_id) instead of continuing
Remove intercepts when done with await network.remove_intercept(intercept_id) to restore normal network behaviour
Known gotchas
BiDi network interception is supported in Chrome and Firefox but not Safari as of mid-2026; always check target browser compatibility before adopting this approach
BiDi and CDP cannot intercept the same request simultaneously in Chromium; using Selenium's BiDi intercept while DevTools protocol is also active may produce double-intercept errors
The addIntercept API is part of the W3C BiDi spec but high-level Python bindings may lag the spec; verify the exact method names against the installed selenium package version
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp