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
- Added spawn and execFile to execute external programs (issue 10219)
- Added the ability to abort network requests (issue 10230)
- Added system access to stdin, stdout, and stderr (issue 10333)
- Added support for custom CA certificates location (issue 10916)
- Added seek function to the File stream (issue 10937)
- Implemented file read for a specified number of bytes (issue 10938)
- Added a callback to handle network error (issue 10954, issue 10997)
- Added custom encoding support when opening a page (issue 11043)
- Implemented require.stub() support for a factory function (issue 11044)
- Added page loading indicator and progress (issue 11091)
- Added a timeout option for network requests (issue 11129)
Improvements
- Fixed the build on FreeBSD (issue 10597)
- Ensured a consistent 72 dpi for Linux headless rendering (issue 10659)
- Fixed possible PDF error due to invalid CreationDate field (issue 10663)
- Fixed crash when uploading non existing files (issue 10941)
- Improved the autocomplete internal of the interactive/REPL mode (issue 10943)
- Fixed possible crash when accessing inline frames (issue 10947)
- Changed Linux binary package setup to be built on CentOS 5 (issue 10963)
- Extended SSL ignore setting to synchronous XHR (issue 10985)
- Added convenient constants for modifier keys (issue 11056)
- Fixed incorrect date handling in the cookies (issue 11068)
- Updated GhostDriver to version 1.0.3 (issue 11146)
Examples
- Fixed invalid data URI in the netsniff example (issue 10740)
- Implemented a new weather example (issue 10794)
- Fixed rendering issues in render_multi_url (issue 11021)
- Fixed proper event sequence in page_events example (issue 11028)
- Miscellanous tweaks (issue 11082)
Fixes in 1.9.1
- Fixed problems with specifying proxy server (issue 10811, 11117)
- Fixed UTF-8 encoding with system.stdout and system.stderr (issue 11162)
- Ensured that onResourceReceived will be always invoked (issue 11163)
- Fixed module loading from an absolute path on Windows (issue 11165)
- Fixed typo in the command-line option for setting the cache size (issue 11219)
- Fixed possible crash when handling network requests (issue 11252, 11338)
Fixes in 1.9.2
- Fixed graphical artifacts with transparent background on Windows (issue 11276, 11007, 11366)
- Updated GhostDriver to version 1.0.4 (issue 11452)
Fixes in 1.9.3
- Fixed CoreText performance note on OS X 10.9 (issue 11418)
- Fixed warning of obsolete userSpaceScaleFactor on OS X 10.9 (issue 11612)
Fixes in 1.9.6
- Updated GhostDriver to version 1.1.1 (issue 11877, 11893)
Fixes in 1.9.7
- Reverted to GhostDriver 1.1.0 instead of 1.1.1 (issue 11915)
- Fixed another warning of obsolete userSpaceScaleFactor on OS X 10.9 (issue 11612)
Fixes in 1.9.8
- Change default SSL protocol to TLSv1 to address POODLE (issue 12655)
- Fixed building on OS X 10.10 Yosemite (issue 12622)
- Backported crash fix when exit (issue 11642, 12431)
Known Issues on Microsoft Windows
- Very slow network performance. The workaround is to set proxy type to "none" (issue 10580)
- Some graphics drivers may cause mysterious crash (issue 10845)
Back to all releases.