This is fantastic. I'm using a combination of Chrome and PhantomJS for karma testing right now, for <a href="https://github.com/paypal/paypal-checkout" rel="nofollow">https://github.com/paypal/paypal-checkout</a> and <a href="https://github.com/krakenjs/xcomponent" rel="nofollow">https://github.com/krakenjs/xcomponent</a>. 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.<p>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.<p>I'm hoping running Chrome in headless mode should give a nice speedup for our tests.<p>-----<p>¹ Turns out even a closed popup window or iframe keeps a huge amount of memory hanging around. Who knew.
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.<p>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 or Windows, and so on.<p>Of the bugs I've submitted, some have been fixed in the upcoming M59, so other critical ones may take longer due to their backlog. I suppose for now (maybe until M61-62), Chrome full with xvfb or even PhantomJS are better options. When you realize that Chrome is about the same size (by LoC) as the Linux kernel [1], you can't help but wish for a leaner & faster headless browser.<p>There seems to be some work going on building Firefox pure headless as well. Great overall, as long as all the browsers try to follow the RemoteDebug initiative [2].<p>[1] <a href="https://josephg.com/blog/electron-is-flash-for-the-desktop/" rel="nofollow">https://josephg.com/blog/electron-is-flash-for-the-desktop/</a><p>[2] <a href="http://remotedebug.org" rel="nofollow">http://remotedebug.org</a>
<a href="https://bitbucket.org/lindenlab/dullahan" rel="nofollow">https://bitbucket.org/lindenlab/dullahan</a><p>I've been working on a fully open source Windows/macOS library (via Chromium Embedded Framework) that allows you to render pages to memory (and then of course to bitmaps, textures etc.) as well as inject synthesized mouse/keyboard/JavaScript events. It currently uses (what amounts to) Chrome 57.<p>Looks like this might make my project obsolete.
A lot of phantom js talk here makes me want to recommend <a href="http://ghostinspector.com" rel="nofollow">http://ghostinspector.com</a><p>It's a phantom js (and other headless browser) web service. Using the site, you can quickly create different tests, scheduled tests, chained tests, keep screen shots, create videos of multi step tests, and have historical information of it all.<p>Can't say enough good things about the site.<p>Edit: also there's a great chrome extension that will record your mouse clicks and keyboard commands to make creating a test that much simpler.
Also checkout <a href="https://github.com/cyrus-and/chrome-remote-interface" rel="nofollow">https://github.com/cyrus-and/chrome-remote-interface</a> for an easy way to fully control those headless instances
The feature I was most interested in when they announced this last year was virtual time. The Developer Resources link has it listed (<a href="https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md" rel="nofollow">https://chromium.googlesource.com/chromium/src/+/lkgr/headle...</a>) but it's a broken link, unfortunately.<p>Mostly, I'd like to know how the control of the virtual time system would be exposed. Would it be through the C++ API, or could it be made available through the debugging protocol?
Shamelessly bumping my project to produce a nice python API for the Chromium/Chrome-remote-debugger-protocol: <a href="https://github.com/fake-name/ChromeController" rel="nofollow">https://github.com/fake-name/ChromeController</a><p>I'm trying to replace PhantomJS in my infrastructure with chromium. Not having to build my own chromium will be a very nice thing.
I've been trying to test audio and video with headless browsers (namely PhantomJS) but have experienced extreme difficulty, I wonder if headless Chrome is able to support/supports already HTMLAudioElement or HTMLVideoElement or any media interface that would make, for example, testing YouTube or SoundCloud embeds easier.
Related: I want to take screenshots of a few news websites for a little fake news project of mine, and most approaches return something completely different than what I'm seeing when I open Chrome.<p>Limited height would be better/ok (something like the first 3000 pixels).<p>Low volume / can be slow (30 seconds would be ok).<p>Those news websites many times have infinite scrolling.<p>I've tried:<p>- phantomJS (rendering sucked, tried every technique I could find to wait for JS to load)<p>- wkhtmltopdf (almost ok, generates a huge 30M image with all the height, no antialiasing it seems)<p>- <a href="https://github.com/gen2brain/url2img" rel="nofollow">https://github.com/gen2brain/url2img</a> (this was the best so far, uses Qt bindings but not the latest version)<p>- actually run a headless browser in DigitalOcean with xvfb-run and take a screenshot: I failed at this<p>What I didn't tried was Selenium, because it seemed even harder.<p>How would you guys do it?
Oh my goodness I have been waiting for this day for a while - we ran into PhantomJS problems with keyboard/mouse eventing and the HTMLVideoElement for testing, this sounds like it should be the cure for our woes of having to hack around PhantomJS's deficiencies.
Almost one year old but there was a talk on headless chrome at the Blink conference (BlinkOn 6):<p>Video: <a href="https://youtu.be/GivjumRiZ8c" rel="nofollow">https://youtu.be/GivjumRiZ8c</a><p>Slides: <a href="https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcxzMQNEE7PcuQrGu83No3l0lw" rel="nofollow">https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcx...</a><p>More links:
Headless Chrome architecture: <a href="https://docs.google.com/document/d/11zIkKkLBocofGgoTeeyibB2TZ_k7nR78v7kNelCatUE/" rel="nofollow">https://docs.google.com/document/d/11zIkKkLBocofGgoTeeyibB2T...</a><p>Mailing list: <a href="https://groups.google.com/a/chromium.org/forum/#!forum/headless-dev" rel="nofollow">https://groups.google.com/a/chromium.org/forum/#!forum/headl...</a><p>All of those links are on <a href="https://chromium.googlesource.com/chromium/src.git/+/master/headless/README.md" rel="nofollow">https://chromium.googlesource.com/chromium/src.git/+/master/...</a>
How fast is headless vs. normal? According to<p><a href="https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-tree-construction" rel="nofollow">https://developers.google.com/web/fundamentals/performance/c...</a><p>the chrome browser spends a decent amount of time on other steps such as parsing HTML. I wonder how much time could be saved by not rendering pages into pixels.
I put together an example of how to run chromium with --headless driven by cucumber/capybara: <a href="https://dkastner.github.io/2017/04/21/headless-chrome.html" rel="nofollow">https://dkastner.github.io/2017/04/21/headless-chrome.html</a>
For those interested, Firefox is also going to support a headless mode. The current nightly supports headless SlimerJS on Linux and more platforms will come soon.<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1338004" rel="nofollow">https://bugzilla.mozilla.org/show_bug.cgi?id=1338004</a>
Looks like the launch bug is private? <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=705916" rel="nofollow">https://bugs.chromium.org/p/chromium/issues/detail?id=705916</a>
Have people found many issues that come up in Chrome but aren't found in PhantomJS? We used to use a headless browser but switched to PhantomJS and haven't had any real issues.<p>(We should probably run under the real IE but jut haven't been bothered.)
Can anyone confirm - would this work with a Flash/SWF application? i.e. could I use the headless mode to interact with the Flash Application to run some commands and retrieve the output?<p>I tried googling around but didnt find much to say either way...
It seems that Chromium 59 still can not be installed on Raspberry Pi, or anyone has done it?<p>It will be great to use this headless Chromium on Raspberry Pi to execute some routine web browser jobs.<p>Does it support the extensions installed on Chromium? Curious.
How fast is the debugging mode? I tried the first debugging protocol when Chrome added it and it was very difficult to use. I assume this time is different?
Doesn't seem to work on OSX. Connecting to debug port from a different chrome brings up an empty page.<p>Running Version 59.0.3069.0 (Official Build) canary (64-bit)
i use when they announced headless mode on linux, and built generating thumbnails from captured screenshots of websites and uncovering the technologies used on websites<p>and the api is available for free, <a href="https://github.com/letsvalidate/api" rel="nofollow">https://github.com/letsvalidate/api</a>