There are some differences between SlimerJS and PhantomJS 1.9.1 although we tried to implement the same behaviors of PhantomJS APIs.
Many of differences come from differences between these two web platforms, Webkit and Gecko. So we couldn’t suppress these differences in SlimerJS. There are also some few differences that exist in the API because it was our choice.
So here are some of these differences. This list is not exhaustive of course! We found most of them during the port of CasperJS on SlimerJS.
webpage.sendEvent() for key events is more consistent. In PhantomJS, there are several issues.
webpage.open() returns a promise. It’s easier to chain things executed asynchronously
The call of webpage.open() (or openUrl()), in PhantomJS, ends when the load is starting. But in SlimerJS it ends almost immediately because it should open a real window before the loading and it is done asynchronously. So probably some properties will not be available immediately after the call of open() in SlimerJS.
It seems that the call of listeners during the page loading is not done at the same step between PhantomJS and SlimerJS. Implementation in PhantomJS is a bit obscure.
webpage.open() and openUrl() support only “GET” and “POST” operation in SlimerJS, no “PUT” nor “DELETE” operations.
The webserver object has more methods to configure it easily
PhantomJS has a strange behavior on fs.read() : it seems it reads files always as binary files. However SlimerJS’s fs.read() strictly respect the ‘b’ flag parameter.
Exit code doesn’t work with SlimerJS (There is no API for that in Gecko)
The callback webpage.onNavigationRequest receives bad parameters. Don’t rely on the navigationType and the isMainFrame values (because of some limitations in the Gecko API).
Callbacks webpage.onLoadStarted and webpage.onLoadFinished receive additionnal parameters in SlimerJS (the url, a boolean indicated if it is in a frame...)