Data, Maps, Usability, and Performance

10 Interesting updates in PhantomJS 1.7

Last updated on September 28, 2012 in Development

Updates to PhantomJS

Last week, PhantomJS got an update and you can check out the release notes to see the improvements. I definitly like the generic module update and better cookie handling. Better support for mouse and keyboard related events are also great. But, I am also really looking forward to some of the other features and improvements. These are my top 10:

  1. Mouse Events: Left-click, Right-Click, Middle-Click and Double-Click
  2. Keyboard Events: keyup, keydown, and keypress (sends one character or sequence of characters)
  3. Pageref attribute was added to HAR netsniff.js example and end-time
  4. Support for page closing: now we have a “page.close()” and “page.onClosing = function(page){}” callback.
  5. Support for current page url, current frame url, current frame HTML content, and current frame content in Plain Text
  6. Redesign of the Cookies API: NEW METHODS page.addCookie({cookie}), page.deleteCookie(name), page.clearCookies(), and phantom.cookiesEnabled = boolean
  7. Module system support for generic modules
  8. Support for Window Popups: finally you can properly handle popups with Phantom.
  9. Fixed font antialiasing on Windows
  10. Fixed rendering of ICO images on Windows

Also, I should add that updating PhantomJS to the latest is really easy if you installed it via brew on Mac OSX. I just ran brew upgrade PhantomJS and it automatically updated Phantom from 1.5 to 1.7. Then I did a git pull for the examples directory. My netsniff.js example is now enhanced and the pages object has an onLoad timing under pageTimings. Now, I am just waiting for feature 230 to be implemented: Ability to prevent resources from being loaded.


It looks like feature 230 was implemented and now you can request.abort which is awesome!

Tags: ,

Facebook Twitter Hacker News Reddit More...