Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

How to turn off loading images, css and fonts? #172

Open
tomclancys opened this issue Mar 17, 2022 · 0 comments
Open

How to turn off loading images, css and fonts? #172

tomclancys opened this issue Mar 17, 2022 · 0 comments

Comments

@tomclancys
Copy link

Hello.

I found such a code to turn off the loading of images, css and fonts, but did not fully understand how to implement it in puppeteer. And is it even possible to do this?

The code:
page.on('request', (req) => { if(req.resourceType() == 'stylesheet' || req.resourceType() == 'font' || req.resourceType() == 'image'){ req.abort(); } else { req.continue(); } });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant