Request interception is a browser-automation feature that pauses matching network requests before the browser sends them, giving code a chance to inspect the request and then continue it, modify supported fields, abort it, or fulfill it with a synthetic response.
In Playwright, page.route or browserContext.route registers a pattern and handler. route.continue passes the request onward, route.abort fails it, and route.fulfill returns a response without contacting the destination. Context-level routes cover every page in that browser context, while page-level routes are narrower.
The handler must resolve every intercepted request. Forgetting to continue, abort, fulfill, or fall back leaves the request paused and can make navigation appear to hang. Keep patterns narrow so image-blocking or API capture rules do not accidentally catch documents, authentication, or unrelated origins.
Scrapers use interception to observe JSON requests a page makes, remove nonessential resource types, add an allowed header, or save a response shape for debugging. Testing tools also use it to mock APIs, but a mocked response is test data and must never be mistaken for evidence collected from the live source.
Some headers belong to the browser's network stack. Playwright documents that Cookie, Host, Accept-Encoding, Content-Length, and Sec-Fetch fields are not reliably visible or overridable in the early route handler; cookie changes should go through the browser context's cookie store.
Playwright treats a request and its redirects as one unit for routing: the handler runs for the original request and the browser follows redirects. Inspect redirectedFrom relationships and the final response URL when provenance matters instead of assuming each hop triggers the same handler.
A service worker can take over requests before page routing exposes the events you expect. When interception appears incomplete, determine whether a service worker owns the traffic and, if the workflow permits, run a context with service workers blocked for a clearer network trace.
How Crawlora handles this
Request interception is useful when maintaining a custom browser workflow. Crawlora's platform endpoints expose supported source operations as documented API calls, which avoids binding collection logic to a page's private request patterns for those sources.
Related reading
Glossary
FAQ
No. A listener observes traffic without pausing it. Interception inserts a route handler that must explicitly continue, abort, fulfill, or delegate each matching request.
Not reliably. The browser network stack owns Cookie and ignores a replacement passed through route.continue. Add or remove cookies through the browser context's cookie APIs instead.
A service worker may own them, the route pattern may not match, or the traffic may belong to a different context. Check routing scope and service-worker behavior before widening the handler.
Beyond Request Interception, Crawlora's own docs cover the rest of the stack — browse the APIs, test a request in Playground, and move from scraping infrastructure work to production data workflows.