Live data from Hacker News

Chrome 59 has cross-platform headless support

chromestatus.com

1–10 of 161 posts

Re: Chrome 59 has cross-platform headless support

#4
post #3

Please let this be capable of generating PDFs from HTML from the command line.

FWIW, you can do that now, using phantomjs (which is chrome) http://phantomjs.org/screen-capture.html

> FWIW, you can do that now, using phantomjs (which is chrome) http://phantomjs.org/screen-capture.html

It's based on webkit.

Re: Chrome 59 has cross-platform headless support

#5
post #3

Please let this be capable of generating PDFs from HTML from the command line.

FWIW, you can do that now, using phantomjs (which is chrome) http://phantomjs.org/screen-capture.html

specifically it's qtwebkit and an old version of it.

Re: Chrome 59 has cross-platform headless support

#7
post #3

Please let this be capable of generating PDFs from HTML from the command line.

FWIW, you can do that now, using phantomjs (which is chrome) http://phantomjs.org/screen-capture.html

It's a useful tool (and huge thanks to those who built it -- and SlimerJS for that matter) but whenever I've reached for there's always been some issue to resolve, generally relating to the exact version and/or set of APIs supported. Headless mode (with PDF support -- which it looks like the latest version of the Chromium remote protocol does indeed have) built into a mainstream browsers is nearly guaranteed to be a smoother experience.

Re: Chrome 59 has cross-platform headless support

#10
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 careful to de-reference closed windows properly¹, and only uses a maximum of 150mbs. PhantomJS eats up almost 6GB of memory before it's done, which makes it almost unusable on machines with less memory or CI boxes. Travis is a no-go.

I'm hoping running Chrome in headless mode should give a nice speedup for our tests.

-----

¹ Turns out even a closed popup window or iframe keeps a huge amount of memory hanging around. Who knew.

Post reply on HN