chrome-remote-interface icon indicating copy to clipboard operation
chrome-remote-interface copied to clipboard

Is Request Interception supported?

Open jackalcooper opened this issue 5 years ago • 2 comments

For instance

page.setRequestInterception(true)
page.on('request', request => {
    if (request.resourceType() === 'image' ||
        request.resourceType() === 'stylesheet' ||
        request.resourceType() === 'stylesheet' ||
      )
      request.abort();
    else {
      request.continue();
    }
  });
  return page

jackalcooper avatar May 31 '19 16:05 jackalcooper

Since this library is meant to be a thin wrapper around the RPC framework, there's quite a bit of manual effort involved in getting this to work. However, this is fully supported through Chrome's debugger protocol. This is a bit of speculation of how you would probably go about achieving this:

In the future, I'd like to make a higher-level API that provides some niceties like the above, mimicking some of the convenience features of Puppeteer. :)

andrewvy avatar May 31 '19 16:05 andrewvy

Thanks for reply. I will give it a try. 👍

jackalcooper avatar Jun 01 '19 02:06 jackalcooper