Execute a PhantomJS fragment. Provides extra functionality not found in WebDriver
but available in PhantomJS.
See the
PhantomJS API
for details on what is available.
The javascript this keyword points to the currently selected page that is available for use.
If there is no page yet, one is created.
When overriding any callbacks be sure to wrap in a try/catch block, as failures
may cause future WebDriver calls to fail.
Certain callbacks are used by GhostDriver (the PhantomJS WebDriver implementation)
already. Overriding these may cause the script to fail. It's a good idea to check
for existing callbacks before overriding.