Unable to page.setRequestInterception(true) if connecting to chrome
See original GitHub issueFor the browser instance puppeteer.launch it can do somethings like
await page.setRequestInterception(true);
page.on('request', request => {
if (request.resourceType() === 'image') {
request.abort();
}
else {
request.continue();
}
});
But it can not setRequestInterception(true) for a chrome instance ( I do puppeteer connect with chromelaucher or create a chrome with remote debug port manually)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:13 (4 by maintainers)
Top Results From Across the Web
how do POST request in puppeteer? - google chrome
I was having the issue that all of my page resources (scripts, CSS) were failing to load once I added POST data in...
Read more >puppeteer-core@19.4.1 - jsDocs.io
A high-level API to control headless Chrome over the DevTools Protocol ... A Browser is created when Puppeteer connects to a Chromium ...
Read more >Automation Protocols - WebdriverIO
If it can't find such driver it falls back to use Chrome DevTools using ... const page = (await puppeteer.pages())[0] ... setRequestInterception(true)
Read more >Web Scraping with a Headless Browser: A Puppeteer Tutorial
The interceptor can be defined in the following way: await page.setRequestInterception(true); page.on('request', (request) => { ...
Read more >Top 5 chrome-aws-lambda Code Examples - Snyk
newPage(); const nowTime = +new Date(); let reqCount = 0; await page.setRequestInterception(true); page.on('request', (request) => { const url ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So why exactly was this closed? The issue remains.
@aslushnikov Since you’re already interpreting that code, can you see why
response
would be null? I got it from your comment here (https://github.com/GoogleChrome/puppeteer/issues/749#issuecomment-328600349). Unfortunately,response
is alwaysnull
so trying to gettext()
from it causes aTypeError
.Edit: I think
response
being null is related to the interception failure. The following is never logged: