bosondata / chrome-prerender

Render JavaScript-rendered page as HTML/PDF/mhtml/png/jpeg using Headless Chrome
MIT License
165 stars 20 forks source link

Useragent compatability with nodejs prerender #15

Closed Nyoroon closed 7 years ago

Nyoroon commented 7 years ago

Current user agent is default chrome user agent. Some configurations of web-servers require "Prerender" in user agent string to work correctly. It's possible to change user agent from chrome-prerender?

Nyoroon commented 7 years ago

Example config https://gist.github.com/thoop/8165802

messense commented 7 years ago

There is a set_user_agent method, it's unused for now.

Chrome supports --user-agent argument on command line to override default user-agent but it seems that it's not working together with --headless last time I checked.