Skip to main content
Intercept requests before they leave the browser — block trackers, stub an API, or answer a basic-auth challenge — without a proxy server. Rules are evaluated inside the runtime, so decisions cost zero round-trips, and they are lazily armed: a browser with no rules pays nothing. CLI and cURL examples use $RT and browser b1 (Sessions).

Block or mock requests

intercept installs the browser’s full rule set — each call replaces the previous one. Every rule carries a caller-chosen id, a url_pattern glob (* matches across /), an optional resource_type filter (Document, Script, XHR, Image, … — empty matches everything), and an action:
  • continue — let the request through (useful to carve exceptions)
  • block — fail the request in-page
  • mock — answer it locally with mock_status, mock_headers, and mock_body_b64 (the response body, base64-encoded)
  • allowlist — block everything that does not match this rule
Both calls return {ok: true} — remove rules later by passing their ids to intercept_clear, or omit rule_ids to clear every rule on the scope.

Answer a login wall

Sites behind HTTP basic or digest auth challenge the browser before any page loads. auth installs credentials that answer the challenge in the runtime — the page just loads. Prefer secret_ref over password so the credential travels as a secret-store reference and never enters agent context; pass clear=True to drop the credentials again.