docs(api.md): Fix sample code in API doc (#1821)

Because `Request.url` is changed to `Request.url()`.
This commit is contained in:
Sakamoto, Kazunori 2018-01-19 14:39:50 +09:00 committed by Andrey Lushnikov
parent 2bf42fd779
commit 102f10cbc7

View File

@ -1121,7 +1121,7 @@ puppeteer.launch().then(async browser => {
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on('request', interceptedRequest => {
if (interceptedRequest.url.endsWith('.png') || interceptedRequest.url.endsWith('.jpg'))
if (interceptedRequest.url().endsWith('.png') || interceptedRequest.url().endsWith('.jpg'))
interceptedRequest.abort();
else
interceptedRequest.continue();