PhantomJS 1.9 Release Notes

PhantomJS 1.9, Sakura, was released on March 20, 2013. It came with an updated GhostDriver, an improved resource loading control, as well as other incremental improvements.

Note: PhantomJS 1.9 is the last release in the 1.x series. For the next 2.x series, the core implementation will be ported to Qt 5 to get a more modern base platform, as well as to have an updated WebKit module.

Network requests control

A new functionality is provided so that every network request can be aborted. This is quite similar to the existing support for intercepting those requests (for monitoring purposes), except now any unwanted requests could be blocked as well. The following code fragment demonstrate the use:

page.onResourceRequested = function(requestData, request) {
    if ((/http:\/\/.+?\.css$/gi).test(requestData['url'])) {
        request.abort();
    }
};

If a request has an associated URL ending with .css, it will not be routed to the server. Effectively, this means that the page is loaded without any stylesheets (often useful to check for connection failures). Matching the URL with the main resource URL can also be used to exclude third-party assets.

Of course, the URL matching can be more complicated than these simple examples.

New features

Improvements

Examples

Fixes in 1.9.1

Fixes in 1.9.2

Fixes in 1.9.3

Fixes in 1.9.6

Fixes in 1.9.7

Fixes in 1.9.8

Known Issues on Microsoft Windows

Back to all releases.