mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
example 'block images' - make extension check case insensitive (#401)
This commit is contained in:
parent
9ede3144c5
commit
3b03fdd2d0
@ -22,7 +22,7 @@ const browser = await puppeteer.launch();
|
|||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await page.setRequestInterceptionEnabled(true);
|
await page.setRequestInterceptionEnabled(true);
|
||||||
page.on('request', request => {
|
page.on('request', request => {
|
||||||
if (/\.(png|jpg|jpeg|gif|webp)$/.test(request.url))
|
if (/\.(png|jpg|jpeg|gif|webp)$/i.test(request.url))
|
||||||
request.abort();
|
request.abort();
|
||||||
else
|
else
|
||||||
request.continue();
|
request.continue();
|
||||||
|
Loading…
Reference in New Issue
Block a user