TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Chrome 59 has cross-platform headless support

834 pointsby vvoyerabout 8 years ago

39 comments

bluepnumeabout 8 years ago
This is fantastic. I&#x27;m using a combination of Chrome and PhantomJS for karma testing right now, for <a href="https:&#x2F;&#x2F;github.com&#x2F;paypal&#x2F;paypal-checkout" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;paypal&#x2F;paypal-checkout</a> and <a href="https:&#x2F;&#x2F;github.com&#x2F;krakenjs&#x2F;xcomponent" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;krakenjs&#x2F;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&#x27;m careful to de-reference closed windows properly¹, and only uses a maximum of 150mbs. PhantomJS eats up almost 6GB of memory before it&#x27;s done, which makes it almost unusable on machines with less memory or CI boxes. Travis is a no-go.<p>I&#x27;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.
评论 #14103443 未加载
评论 #14104591 未加载
评论 #14102846 未加载
评论 #14105115 未加载
评论 #14102736 未加载
评论 #14102631 未加载
评论 #14105608 未加载
nreeceabout 8 years ago
I&#x27;ve been testing Chrome headless extensively for the past few months, and while it&#x27;s a good step, but it&#x27;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&#x2F;hangs, there are many inconsistencies between features available in full version and headless, their debugging protocol has different APIs that work on headless&#x2F;non-headless in Linux or Windows, and so on.<p>Of the bugs I&#x27;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&#x27;t help but wish for a leaner &amp; 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:&#x2F;&#x2F;josephg.com&#x2F;blog&#x2F;electron-is-flash-for-the-desktop&#x2F;" rel="nofollow">https:&#x2F;&#x2F;josephg.com&#x2F;blog&#x2F;electron-is-flash-for-the-desktop&#x2F;</a><p>[2] <a href="http:&#x2F;&#x2F;remotedebug.org" rel="nofollow">http:&#x2F;&#x2F;remotedebug.org</a>
评论 #14104359 未加载
评论 #14103685 未加载
评论 #14104960 未加载
评论 #14103528 未加载
callumprenticeabout 8 years ago
<a href="https:&#x2F;&#x2F;bitbucket.org&#x2F;lindenlab&#x2F;dullahan" rel="nofollow">https:&#x2F;&#x2F;bitbucket.org&#x2F;lindenlab&#x2F;dullahan</a><p>I&#x27;ve been working on a fully open source Windows&#x2F;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&#x2F;keyboard&#x2F;JavaScript events. It currently uses (what amounts to) Chrome 57.<p>Looks like this might make my project obsolete.
评论 #14103452 未加载
MichaelApprovedabout 8 years ago
A lot of phantom js talk here makes me want to recommend <a href="http:&#x2F;&#x2F;ghostinspector.com" rel="nofollow">http:&#x2F;&#x2F;ghostinspector.com</a><p>It&#x27;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&#x27;t say enough good things about the site.<p>Edit: also there&#x27;s a great chrome extension that will record your mouse clicks and keyboard commands to make creating a test that much simpler.
评论 #14103669 未加载
评论 #14103327 未加载
vvoyerabout 8 years ago
Also checkout <a href="https:&#x2F;&#x2F;github.com&#x2F;cyrus-and&#x2F;chrome-remote-interface" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cyrus-and&#x2F;chrome-remote-interface</a> for an easy way to fully control those headless instances
评论 #14102634 未加载
评论 #14105839 未加载
skibzabout 8 years ago
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:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src&#x2F;+&#x2F;lkgr&#x2F;headless&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src&#x2F;+&#x2F;lkgr&#x2F;headle...</a>) but it&#x27;s a broken link, unfortunately.<p>Mostly, I&#x27;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?
ctphippsabout 8 years ago
Any way of scripting this to automate button clicks etc? I use PhantomJS for this now but found it to be incredibly unstable for complex pages.
评论 #14102359 未加载
评论 #14102658 未加载
评论 #14102577 未加载
评论 #14104631 未加载
评论 #14102349 未加载
fake-nameabout 8 years ago
Shamelessly bumping my project to produce a nice python API for the Chromium&#x2F;Chrome-remote-debugger-protocol: <a href="https:&#x2F;&#x2F;github.com&#x2F;fake-name&#x2F;ChromeController" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;fake-name&#x2F;ChromeController</a><p>I&#x27;m trying to replace PhantomJS in my infrastructure with chromium. Not having to build my own chromium will be a very nice thing.
vmastoabout 8 years ago
I&#x27;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&#x2F;supports already HTMLAudioElement or HTMLVideoElement or any media interface that would make, for example, testing YouTube or SoundCloud embeds easier.
swahabout 8 years ago
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&#x27;m seeing when I open Chrome.<p>Limited height would be better&#x2F;ok (something like the first 3000 pixels).<p>Low volume &#x2F; can be slow (30 seconds would be ok).<p>Those news websites many times have infinite scrolling.<p>I&#x27;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:&#x2F;&#x2F;github.com&#x2F;gen2brain&#x2F;url2img" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gen2brain&#x2F;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&#x27;t tried was Selenium, because it seemed even harder.<p>How would you guys do it?
评论 #14105802 未加载
评论 #14105814 未加载
评论 #14105737 未加载
yarpabout 8 years ago
Any chance for webgl here? Would be nice for automatic screenshots and webgl tests.
评论 #14102569 未加载
评论 #14102792 未加载
Bahamutabout 8 years ago
Oh my goodness I have been waiting for this day for a while - we ran into PhantomJS problems with keyboard&#x2F;mouse eventing and the HTMLVideoElement for testing, this sounds like it should be the cure for our woes of having to hack around PhantomJS&#x27;s deficiencies.
iAm25626about 8 years ago
Nice!! Would creating WebRTC data channel be possible?<p>server side SCTP to client(p2p over SCTP&#x2F;data channel) would be cool.
评论 #14103221 未加载
arrowgunzabout 8 years ago
What does this mean for Electron and other apps that depend on Electron?
评论 #14102999 未加载
评论 #14102573 未加载
ericbabout 8 years ago
Would this run as a chrome driver for Selenium? What is needed to make this work with Selenium?
评论 #14104865 未加载
评论 #14104978 未加载
vvoyerabout 8 years ago
Almost one year old but there was a talk on headless chrome at the Blink conference (BlinkOn 6):<p>Video: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;GivjumRiZ8c" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;GivjumRiZ8c</a><p>Slides: <a href="https:&#x2F;&#x2F;docs.google.com&#x2F;presentation&#x2F;d&#x2F;1gqK9F4lGAY3TZudAtdcxzMQNEE7PcuQrGu83No3l0lw" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;presentation&#x2F;d&#x2F;1gqK9F4lGAY3TZudAtdcx...</a><p>More links: Headless Chrome architecture: <a href="https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;11zIkKkLBocofGgoTeeyibB2TZ_k7nR78v7kNelCatUE&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;11zIkKkLBocofGgoTeeyibB2T...</a><p>Mailing list: <a href="https:&#x2F;&#x2F;groups.google.com&#x2F;a&#x2F;chromium.org&#x2F;forum&#x2F;#!forum&#x2F;headless-dev" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;a&#x2F;chromium.org&#x2F;forum&#x2F;#!forum&#x2F;headl...</a><p>All of those links are on <a href="https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src.git&#x2F;+&#x2F;master&#x2F;headless&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src.git&#x2F;+&#x2F;master&#x2F;...</a>
mstadeabout 8 years ago
Fantastic news, not a minute too soon! Can&#x27;t wait to get rid of PhantomJS. Now if only this was a standard feature of all browsers...
estabout 8 years ago
Is it possible to install Chromium on a server without X environment? Last time I checked it requires a shit ton of dependencies.
livorasabout 8 years ago
PhantomJS has plenty unsolved issues(up to 1.7k+), a replacement instead of combination might be a better choice.
tianlinsabout 8 years ago
How fast is headless vs. normal? According to<p><a href="https:&#x2F;&#x2F;developers.google.com&#x2F;web&#x2F;fundamentals&#x2F;performance&#x2F;critical-rendering-path&#x2F;render-tree-construction" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;web&#x2F;fundamentals&#x2F;performance&#x2F;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.
retubeabout 8 years ago
This page doesn&#x27;t load for me (IE behind corp firewall). How does one drive&#x2F;automate a headless browser? What kind of API is there?
评论 #14105795 未加载
dkastnerabout 8 years ago
I put together an example of how to run chromium with --headless driven by cucumber&#x2F;capybara: <a href="https:&#x2F;&#x2F;dkastner.github.io&#x2F;2017&#x2F;04&#x2F;21&#x2F;headless-chrome.html" rel="nofollow">https:&#x2F;&#x2F;dkastner.github.io&#x2F;2017&#x2F;04&#x2F;21&#x2F;headless-chrome.html</a>
brendandahlabout 8 years ago
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:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1338004" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1338004</a>
hackcasualabout 8 years ago
Looks like the launch bug is private? <a href="https:&#x2F;&#x2F;bugs.chromium.org&#x2F;p&#x2F;chromium&#x2F;issues&#x2F;detail?id=705916" rel="nofollow">https:&#x2F;&#x2F;bugs.chromium.org&#x2F;p&#x2F;chromium&#x2F;issues&#x2F;detail?id=705916</a>
smackfuabout 8 years ago
Have people found many issues that come up in Chrome but aren&#x27;t found in PhantomJS? We used to use a headless browser but switched to PhantomJS and haven&#x27;t had any real issues.<p>(We should probably run under the real IE but jut haven&#x27;t been bothered.)
评论 #14102907 未加载
评论 #14102862 未加载
laurenceiabout 8 years ago
Can anyone confirm - would this work with a Flash&#x2F;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...
du_bingabout 8 years ago
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.
amingilaniabout 8 years ago
Does this mean I no longer need to use phantomjs for my tests?
wslhabout 8 years ago
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?
armitronabout 8 years ago
Doesn&#x27;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)
评论 #14104877 未加载
评论 #14103313 未加载
_pdp_about 8 years ago
This is great if the headless mode supports the web extension API because it means that we can run our security tools almost as command line tools.
hbakhtiyorabout 8 years ago
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:&#x2F;&#x2F;github.com&#x2F;letsvalidate&#x2F;api" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;letsvalidate&#x2F;api</a>
0xFFCabout 8 years ago
Can somebody explain to me what is this good for?<p>Thank you.
评论 #14104641 未加载
评论 #14114759 未加载
stheakanathabout 8 years ago
Is this confirmed to work with Flash? I know selenium did not support Flash so it caused some dev issues.
MR4Dabout 8 years ago
Given the rough comments on the Electron story earlier, this should be welcome by all.
zigomirabout 8 years ago
Not sure if this can enable SSR (server side rendering) for any client side lib?
unixheroabout 8 years ago
What is the use case for headless Chrome?
评论 #14108586 未加载
softwarelimitsabout 8 years ago
is this is chromium, too?
masterleepabout 8 years ago
Please let this be capable of generating PDFs from HTML from the command line.
评论 #14102350 未加载
评论 #14102777 未加载
评论 #14102515 未加载
评论 #14102499 未加载
评论 #14103375 未加载
评论 #14104201 未加载
评论 #14102261 未加载