Пример #1
0
 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)
         )
Пример #2
0
 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))