There is also headless chrome browser in development, not sure if there are any prebuilt binaries out there?
There is also headless chrome browser in development, not sure if there are any prebuilt binaries out there?
I build from chromium src, and my code is more or less an extension with its own BUILD.gn with a deps on //headless. Once you've built the initial tree (took a night for me), builds will be really fast.
Most of the interaction with the browser is by the chrome debugging protocol, as with "normal" chromium. Generally speaking, you want to target that, instead of the internal APIs.
There are some tweaks you need to be aware of. Chromium needs a homedir, so you want to configure that. There's state stored between sessions, so if you want process invocations stateless, consider spending some time hacking or run the process in a fresh namespace/chroot/docker/jail/whatever each time. I had to write my own protocol handler and URLRequestJobs because I render pages from archives on disk and that was the easiest way to get that started at the time.
I don't know if vanilla chromium supports it, but I'm pretty sure I've seen a --headless flag somewhere... If not, headless_shell is pretty easy to build following the official build instructions[1]. I'm running on RHEL/Fedora/CentOS. There's also unofficial images on docker hub if you want to go that route.
[1]: https://chromium.googlesource.com/chromium/src/+/lkgr/headle...
https://bugs.chromium.org/p/chromium/issues/detail?id=546953...
- Start a 'selenium hub'
- Start up as many firefox/chrome 'node' containers and link them to the hub.
- Point webdriver at the hub port and url.
I will eventually get around to building some Alpine containers for this, one day. I find the official ones a bit 'heavy' given all it really invoves in installing openJDK and running a jar file / browser driver.
download support[1] is the only new api in development. it's not tagged for the 2.5 release[2].
[1] https://github.com/ariya/phantomjs/pull/14225 [2] https://github.com/ariya/phantomjs/issues/14458
There has been an open issue for this for three years[1].
I check every now and again. I'm super interested in headless PDF generation (using Nigtmare now)
[1] https://bugs.chromium.org/p/chromium/issues/detail?id=546953