rsify / pico

Take browser screenshots in Javascript 📸
MIT License
1.96k stars 45 forks source link

Proxy failed CORS requests #1

Open rsify opened 4 years ago

rsify commented 4 years ago

Many foreign origin CDN's don't set CORS headers when serving their assets (images, style sheets, fonts) which leads to our program not being able to read the asset's contents. For situations like that it seems that the only workaround is falling back onto a simple proxy that will fetch the asset and serve it with friendly CORS headers.

The proxy only needs to be really simple, I haven't thought of exact requirements but this gist looks like a good resource to start with.

rsify commented 4 years ago

Another inspiration source https://github.com/niklasvh/html2canvas-proxy-nodejs

AutoSponge commented 4 years ago

You can also run chrome with security disabled --disable-web-security flag. But at that point you should probably just use puppeteer/playwright/CDP.