Installing SlimerJS on the Raspberry Pi 2


SlimerJS is similar to PhantomJS, but uses XULRunner/Mozilla Firefox as the rendering engine.

Install Dependencies

SlimerJS has some dependencies that we will need to install. Running the following command will install what we need from the default Aptitude repository:

sudo apt-get install libnspr4-dev libc6 libstdc++6 \
  libgcc1 libgtk2.0-0 libasound2 libxrender1 xvfb \
  git-core -y

We also need some additional files that are not in the Raspbian repository.

sudo dpkg -i libmozjs24d_24.8.1esr-2~deb7u1_armhf.deb
rm libmozjs24d_24.8.1esr-2~deb7u1_armhf.deb


sudo dpkg -i libmozjs-dev_24.8.1esr-2~deb7u1_armhf.deb
rm libmozjs-dev_24.8.1esr-2~deb7u1_armhf.deb


sudo dpkg -i xulrunner-24.0_24.8.1esr-2~deb7u1_armhf.deb
rm xulrunner-24.0_24.8.1esr-2~deb7u1_armhf.deb


sudo dpkg -i xulrunner-dev_24.8.1esr-2~deb7u1_armhf.deb
rm xulrunner-dev_24.8.1esr-2~deb7u1_armhf.deb

Create a symbolic link for XULRunner

sudo ln -s /usr/lib/xulrunner-24.0/xulrunner /usr/bin/xulrunner

Obtaining SlimerJS

Every user places source code in a different directory, so before you perform any of the following steps, please navigate to that directory first.

We will use git to download the source code for SlimerJS.

git clone
cd slimerjs
git checkout v0.9

Installing SlimerJS

SlimerJS doesn’t really have any building to do, it comes ready to execute. This part of the post will cover how to move it to a location where anyone on the system can execute SlimerJS.

First, we will need to create SlimerJS’ new home, /opt/slimerjs-0.9.

sudo mkdir /opt/slimerjs-0.9

Copy the files to their new home.

sudo cp -R src/ /opt/slimerjs-0.9/
sudo mv /opt/slimerjs-0.9/src /opt/slimerjs-0.9/bin
sudo cp -R examples/ /opt/slimerjs-0.9/

Create a symbolic link to make things friendlier.

sudo ln -s /opt/slimerjs-0.9/ /opt/slimerjs

Update /etc/profile to include SlimerJS paths.

sudo nano /etc/profile

We want to export some values so SlimerJS can be easily found. At the top of the file, add the following lines:

SLIMERJSLAUNCHER=$(which xulrunner)

Find where PATH is set and add the following to the end:


You’ll need to logout, then log back in, to have the /etc/profile changes take effect.

Using SlimerJS

Load Speed

Executing the following code …

xvfb-run bin/slimerjs examples/phantomjs/loadspeed.js

… will result with the following output, which will vary per user and execution:

Loading time 2546 msec

The reason I am executing xvfb-run is because I want SlimerJS to run in a headless mode.

What’s next?

Your best bet is to check out the Documentation for SlimerJS to get a better idea as to what you can do with it.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.