mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
example 'block images' - fix typo and add other extensions (#334)
* fix typo and add extensions to example 'block images' * fix code style, keep the newline at EOF
This commit is contained in:
parent
2655f20fd3
commit
21aa0a2390
@ -22,7 +22,7 @@ const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.setRequestInterceptionEnabled(true);
|
||||
page.on('request', request => {
|
||||
if (/\.(png|jpg|jpeg$)/.test(request.url))
|
||||
if (/\.(png|jpg|jpeg|gif|webp)$/.test(request.url))
|
||||
request.abort();
|
||||
else
|
||||
request.continue();
|
||||
|
Loading…
Reference in New Issue
Block a user