Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Request Interception supported? #33

Open
jackalcooper opened this issue May 31, 2019 · 2 comments
Open

Is Request Interception supported? #33

jackalcooper opened this issue May 31, 2019 · 2 comments

Comments

@jackalcooper
Copy link
Contributor

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 jackalcooper changed the title Is Request Interception supported Is Request Interception supported? May 31, 2019
@andrewvy
Copy link
Owner

andrewvy commented May 31, 2019

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. :)

@jackalcooper
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants