MCPcopy Index your code
hub / github.com/microsoft/playwright-python / route

Method route

playwright/_impl/_browser_context.py:433–447  ·  view source on GitHub ↗
(
        self, url: URLMatch, handler: RouteHandlerCallback, times: int = None
    )

Source from the content-addressed store, hash-verified

431 return await self.expose_binding(name, lambda source, *args: callback(*args))
432
433 async def route(
434 self, url: URLMatch, handler: RouteHandlerCallback, times: int = None
435 ) -> DisposableStub:
436 self._routes.insert(
437 0,
438 RouteHandler(
439 self._base_url,
440 url,
441 handler,
442 True if self._dispatcher_fiber else False,
443 times,
444 ),
445 )
446 await self._update_interception_patterns()
447 return DisposableStub(lambda: self.unroute(url, handler), self)
448
449 async def unroute(
450 self, url: URLMatch, handler: Optional[RouteHandlerCallback] = None

Callers

nothing calls this directly

Calls 4

unrouteMethod · 0.95
RouteHandlerClass · 0.90
DisposableStubClass · 0.90

Tested by

no test coverage detected