update code example: setRequestInterceptionEnabled (#294)

This commit is contained in:
edgar c 2017-08-16 14:19:13 -04:00 committed by Andrey Lushnikov
parent da53218107
commit 3cc5ba4a6f

View File

@ -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