async def route(self, url: URLMatch, handler: RouteHandler) -> None: self._routes.insert( 0, RouteHandlerEntry(URLMatcher(self._options.get("baseURL"), url), handler) ) if len(self._routes) == 1: await self._channel.send( "setNetworkInterceptionEnabled", dict(enabled=True) )
async def route(self, url: URLMatch, handler: RouteHandler) -> None: self._routes.append(RouteHandlerEntry(URLMatcher(url), handler)) if len(self._routes) == 1: await self._channel.send("setNetworkInterceptionEnabled", dict(enabled=True))