Features

What can you do with SlimerJS?

A scriptable browser

SlimerJS allows you to execute a javascript script outside a classical web browser.

In your javascript script, you can use some modules providing many APIs:

  • Read and write files
  • Loading a web page and inspect its content
  • Act on a web page like a user: click on links, fill some form fields etc. You can then inspect the result, to test them or to retrieve them.
  • Listen network events, to do network monitoring during the load of a webpage
  • Taking screenshots of a web page

Your script is also being able to execute CommonJS modules, even those written with the Coffee-Script language! Your main script can be written with Coffee-script as well. SlimerJS recognize *.coffee files.

All of these features are executed on top of the core of Firefox. and are already implemented in SlimerJS.

Disadvantages over PhantomJS

These APIs are similar to the APIs of Phantomjs but there are some few differences in their behaviors. Some options and few features are still missing. This is a work in progress and a full compatibility is the main goal for the release of SlimerJS 1.0.

Contrary to PhantomJS, SlimerJS is not headless: you see windows and it needs a graphical environment. You can use a tool like xvfb on a Linux/MacOS system to have this headless feature and to execute SlimerJS on Linux boxes that have not Xorg installed.

But...

Advantages over PhantomJS

SlimerJS is not only a PhantomJS clone, it contains also additional features right now:

  • Benefit of the power of Javascript 1.8.6, that has already features of the future standard Ecmascript "Harmony" 6: iterators, generators, destructured assignement, Map and WeakMap, "let" keyword...
  • The web page rendering in SlimerJS is strictely identical to the rendering in Firefox
  • Many modules of the Mozilla Addons Sdk are available and you can import it into your code as any CommonJS modules.
  • Supports all last HTML5 standards implemented in Firefox, including things that are not available into PhantomJS: Audio, Video, WebGL etc..
  • SlimerJS is able to load flash content if the Flash plugin is installed
  • You can use promises when opening a web page with webpage.open()!
  • SlimerJS is not really stuck to a specific version of Gecko: it can use any recent version of Firefox/XulRunner 20+

Try SlimerJS for your web projects!