0

I need to handle all request except those sent from the service server. At present, I do it using such a way: capture all requests and into handler filter service requests.

 await client.Fetch.enable({
     patterns: [
        { requestStage: 'Request' }, 
        { requestStage: 'Response' }
     ], // handle all requests and responses.
 });

client.Fetch.on('requestPaused', async (event: RequestPausedEvent) => {
    if (isServiceRoute(event.request.url))
        await continueRequestOrResponse(client, event);

    ...
    //  Handle the necessary events
});
          

Question: Can I do this at client.Fetch.enable() stage? E.g setup the the patterns filter so, it passes all requests (*) and rejects the service routes (started from https://service-domain-1.company.com and https://service-domain-2.company.com).

mlosev
  • 5,130
  • 1
  • 19
  • 31
  • is Network.setBlockedURLs usable for your case? – Raven Nov 14 '22 at 14:21
  • No, the `Network.setBlockedURLs` just block the specified urls. I need another thing: catch all routes instead of service (service routes should be loaded in regular way) – mlosev Nov 29 '22 at 06:55

0 Answers0