Capture web page screenshots headless

For a while now I have been using the Amazon cloud to render web page previews for posts in Feederator. This solution is running in Amazons new free “beginner” quota. For a low load this works quite well, but it never worked to create a thumbnail for all incoming items. I guess it wasn’t working reliably because for every call a virtual framebuffer has to be started, then firefox, then the screenshot and so on… From time to time the available ports to the X server would run out…
So I was looking for another affordable and fast solution. So I found this post and followed the instructions to the letter: http://blog.mozilla.com/ted/2010/07/29/moz-headless-screenshot/ It worked until I wanted to compile the moz-headless-screenshot programm itself. I got the following error:

/usr/lib64/libssl3.so: undefined reference to `CERT_DistNamesFromCertList@NSS_3.12.6′
/usr/lib64/libssl3.so: undefined reference to `CERT_DupDistNames@NSS_3.12.6′
/usr/lib64/libssl3.so: undefined reference to `NSS_SecureMemcmp@NSSUTIL_3.12.5′
collect2: ld returned 1 exit status
make: *** [moz-headless-screenshot] Error 1

I contacted Ted, the writer of the above mentioned blog post and he told me

The mozconfig file in my directions probably contains a line like
“–enable-system-nss”. Try removing that, and the build will use the
in-tree copy of NSS instead.


I then removed the nss library references in his Makefile and recompiled and it worked. Now I’m trying to figure out, how I can package the whole stuff to run it on the cloud…

Posted by Daniel Eichhorn

Daniel Eichhorn is a software engineer and an enthusiastic maker. He loves working on projects related to the Internet of Things, electronics, and embedded software. He owns two 3D printers: a Creality Ender 3 V2 and an Elegoo Mars 3. In 2018, he co-founded ThingPulse along with Marcel Stör. Together, they develop IoT hardware and distribute it to various locations around the world.

Leave a Reply