Hacker News new | past | comments | ask | show | jobs | submit login
Headless Chrome now in stable release
1 point by austincheney on June 8, 2017 | hide | past | favorite
Headless Chrome is here, but Windows support does not appear to be available yet. Please correct me where I am wrong.

To run it as a service you can add this alias to your .bash_profile file:

alias headless="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --disable-gpu --remote-debugging-port=9222 chrome://version"

This does not come with any kind of API, at least none that I can find. I didn't read the source code though.

You can check the status of things in a browser window by going to the service, which in this case would be: http://localhost:9222/

Since there is no API I am still learning how to move around a site without destroying a session.

Instead of running it as a service you can tell it to respond with HTML by replacing the --remote-debugging-port flag with a --dump-dom flag. Please note both of these flags cannot be run together. There seems to be a --screenshot to capture a screenshot of a page.

Here is more information - https://developers.google.com/web/updates/2017/04/headless-chrome




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: