The clock is ticking, but here is some news about getting PhantomJS to
be fully X11-less.
For the setup, I use Ubuntu Lucid installed to a small virtual
machine. I pick the rather outdated Lucid in the hope that if it works
there, it would work on a more modern flavor. The installation is
server oriented, there is no GUI so it's all the fancy text mode.
Packages pulled after the fresh installation are only:
sudo apt-get install build-essential chrpath git-core libssl-dev
libfontconfig1-dev
So far I manage to get various examples working, even rendering the
SVG version of the famous Tiger to PNG! For simplicity, I also let the
minimal Lighthouse implementation baked in rather than making it as a
plugin (I still have a remote hope that static build on Linux would be
possible in the near future). Text is rendered via Freetype2 and
Fontconfig which is nice since we will still get high quality
rendering even on an environment sans GUI.
The attached screenshot shows how I use PhantomJS to render the Tiger
into a PNG and also use another PhantomJS script again to upload the
resulting image (since there is no GUI browser).
The theory is that if this works on a barebone Lucid server, then
we're heading in the right direction :)
Thanks!
Regards,
--
Ariya Hidayat, http://ariya.ofilabs.com
Indeed, Phantomjs is a work of art. I hope to utilize the pure headless feature very soon.
I've pushed the stuff to master branch so if you feel brave, you can
try it now already.
I think JPEG support is broken in the middle of the process, I'm
trying to find the problem.
Best regards,
Hi Brian, I believe in the mean time we keep this pure headless
feature on Linux only (for reasons I'll write later on).
Any specific scenarios why you need this on OS X?
The following scenario is now possible:
* Remote login to your Linux box (could be anywhere in the world)
* Invoke PhantomJS script with remote debugger option
* Open Chrome/Safari and point to the box's IP address + debugger port
* Single-step, watch, breakpoint your script just like in standard's
Web Inspector UI
* Profit!
I know that remote debugging feature is still alien to many people.
Don't worry, there will be a whole wiki page for that soon!
Fun times ahead :)
Does the PhantomJS icon show up in the Dock? If that is the case, it
is already fixed, see
http://code.google.com/p/phantomjs/issues/detail?id=281.
JPEG support has been restored.