Live data from Hacker News

Chrome 59 has cross-platform headless support

chromestatus.com

101–110 of 161 posts

Re: Chrome 59 has cross-platform headless support

#101
post #68

I've been testing Chrome headless extensively for the past few months, and while it's a good step, but it's not stable for high-volume or even diverse set of webpages. Memory usage is pretty high, lot of heavy webpages result in crashes/hangs, there are many inconsistencies between features available in full version and headless, their debugging protocol has different APIs that work on headless/non-headless in Linux…

Thanks for that information. I've been putting off moving over to Chrome headless for https://urlscan.io and haven't had the time to do extensive testing yet. Right now Xvfb works fine for me. Still, I'm running 3 Chrome instances with 16 tabs each in parallel and have to kill the processes every so often because they get "stuck".

Re: Chrome 59 has cross-platform headless support

#103
post #98
post #92

Earlier quoted context omitted.

I've been successfully using Chrome headless in a 500MB Docker container for dumping the DOM for https://www.prerender.cloud/ for months (rendering a large variety of sites without restarts for weeks at a time) Run it with: --js-flags="--max_old_space_size=500" to force the VM to keep it GC'd below 500 Chrome v55 was a 30% memory savings, before that I used 1GB containers. It's not perfect, but I am definitely pushin…

What the best strategy that worked for you on high volumes, multiple tabs or multiple docker instances? I am wondering if multiple tabs is as efficient as multiple windows/instances. Thanks.

I'm using more than one Chrome process so I can kill the processes every so often (e.g. after timeout or when they get stuck). Inside each Chrome instance I use 16 tabs, there might be a number of factors at play:

- Are you worried about same-origin pollution if you run multiple tabs from the same origin in the same process? If so -> Extra process - Do you have to take screenshots? You can only take screenshots of the tab that's in the foreground, so you have to activate it first to take the screenshot. This might fail if you have lots of tabs which roughly trigger at once.

You can see what I've built at https://urlscan.io btw.

Re: Chrome 59 has cross-platform headless support

#104
Almost one year old but there was a talk on headless chrome at the Blink conference (BlinkOn 6):

Video: https://youtu.be/GivjumRiZ8c

Slides: https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcx...

More links: Headless Chrome architecture: https://docs.google.com/document/d/11zIkKkLBocofGgoTeeyibB2T...

Mailing list: https://groups.google.com/a/chromium.org/forum/#!forum/headl...

All of those links are on https://chromium.googlesource.com/chromium/src.git/+/master/...

Re: Chrome 59 has cross-platform headless support

#106
post #30
post #12

Also checkout https://github.com/cyrus-and/chrome-remote-interface for an easy way to fully control those headless instances

If you're using Go, https://github.com/knq/chromedp It's also worth noting that the 57+ series has a nice embedded viewer you can use to view the actual viewport via devtools.

Can you detail what is the embedded viewer and how/when you access it? Thanks.

Re: Chrome 59 has cross-platform headless support

#108

This is fantastic. I'm using a combination of Chrome and PhantomJS for karma testing right now, for https://github.com/paypal/paypal-checkout and https://github.com/krakenjs/xcomponent . There are hundreds of tests opening up hundreds of iframes and popup windows, and sending a lot of cross-window messages, and that ends up being really memory hungry. Chrome deals pretty well with garbage collection, so long as I'm c…

I replied to you on Twitter, but for the sake of discussion, there is a third option that may be worth exploring - using Chrome running in virtualized Windows Manager - https://www.alexkras.com/running-chrome-and-other-browsers-i...

Re: Chrome 59 has cross-platform headless support

#109

This is fantastic. I'm using a combination of Chrome and PhantomJS for karma testing right now, for https://github.com/paypal/paypal-checkout and https://github.com/krakenjs/xcomponent . There are hundreds of tests opening up hundreds of iframes and popup windows, and sending a lot of cross-window messages, and that ends up being really memory hungry. Chrome deals pretty well with garbage collection, so long as I'm c…

We're using xvfb and selenium* for testing and a proper headless support would be a hundred time more stable than the self restarting framebuffer can't wait to move to headless chrome *Yeah I know phantomjs is more cool these days but phantom doesn't support windows height so there's that.

+1 for xvfb

Re: Chrome 59 has cross-platform headless support

#110
post #100

Doesn't seem to work on OSX. Connecting to debug port from a different chrome brings up an empty page. Running Version 59.0.3069.0 (Official Build) canary (64-bit)

Works for me when using https://github.com/cyrus-and/chrome-remote-interface

Looking at https://developer.chrome.com/devtools/docs/debugging-clients, it seems we are missing a Ruby client. Last time I tried it gave me some headaches trying to talk to the websockets, but hopefully someone smarter than me can pick it up.
Post reply on HN