mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
update code example: setRequestInterceptionEnabled (#294)
This commit is contained in:
parent
da53218107
commit
3cc5ba4a6f
@ -632,7 +632,7 @@ const puppeteer = require('puppeteer');
|
||||
puppeteer.launch().then(async browser => {
|
||||
let page = await browser.newPage();
|
||||
await page.setRequestInterceptionEnabled(true);
|
||||
page.on('request', request => {
|
||||
page.on('request', interceptedRequest => {
|
||||
if (interceptedRequest.url.endsWith('.png') || interceptedRequest.url.endsWith('.jpg'))
|
||||
interceptedRequest.abort();
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user