(FORK, works with unmodified Qt 5.3) Scriptable Headless WebKit
 
 
 
 
 
 
Go to file
execjosh 836719f72e Implement CommonJS IO/A read([n Number])
The [IO/A spec][1] for `read` is as follows:

> Read up to n bytes from the stream, or until the end of the stream
> has been reached. [If] n is null, reads up to the block size of the
> underlying device, or up to 1024 bytes if the block size is not
> discernible. If n is not specified, this method always reads the
> full stream until its end is reached. ...

Since discovering the block size of the underlying device is
non-trivial, we will just default to 1024.

**NOTE**

The initial implementation of `File::read()` saves the current
(original) position, seeks to the beginning of the stream,
`readAll`s to the end, and then resets to the original position.

  I think that this behavior is unexpected and should be changed--it
should read from the current position to the end of the stream and
stay there.  The user should explicitly `seek` to the beginning of
the stream when necessary.

  With the current implementation, the user should note that the
position *will not change* after calling `read()` with no arguments.

[1]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods

http://code.google.com/p/phantomjs/issues/detail?id=938
2012-12-25 20:46:14 -08:00
deploy Unix packaging: Fix UPX detection for binary compression. 2012-12-23 14:36:24 -08:00
examples Implement CommonJS IO/A read([n Number]) 2012-12-25 20:46:14 -08:00
rpm Add a spec file to allow creation of an rpm from the (previously built) binary. 2012-11-30 22:31:50 -08:00
src Implement CommonJS IO/A read([n Number]) 2012-12-25 20:46:14 -08:00
test Implement CommonJS IO/A read([n Number]) 2012-12-25 20:46:14 -08:00
tools Make static build work on Linux. 2012-07-14 23:32:31 -07:00
website Moved to gh-pages branch. 2012-04-11 00:44:40 -07:00
.gitignore Add a bunch of gitignores for Windows 2012-12-22 22:36:04 -08:00
CONTRIBUTING.md Contribution guide: highlight various aspects of communication. 2012-09-18 18:23:19 -07:00
ChangeLog More 1.8 materials. 2012-12-21 22:12:05 -08:00
LICENSE.BSD Long live PhantomJS! 2010-12-26 19:49:33 -08:00
README.md Add Mocha-PhantomJS 2012-12-24 17:06:34 -05:00
build.sh Ask for a confirmation before initiating the build. 2012-11-10 00:11:14 -08:00
phantomjs.pro Import the old, working prototype. 2010-12-26 20:15:19 -08:00
third-party.txt Import QCommandLine 0.3.0 into our source tree. 2012-09-03 05:48:58 -07:00

README.md

PhantomJS - Scriptable Headless WebKit

PhantomJS (www.phantomjs.org) is a headless WebKit scriptable with JavaScript or CoffeeScript. It is used by hundreds of developers and dozens of organizations for web-related development workflow.

The latest stable release is version 1.8 (codenamed "Blue Winter Rose"). Follow the official Twitter stream @PhantomJS to get the frequent development updates.

Note: Please do not create a GitHub pull request without reading the Contribution Guide first. Failure to do so may result in the rejection of the pull request.

Use Cases

  • Headless web testing. Lightning-fast testing without the browser is now possible! Various test frameworks such as Jasmine, Capybara, QUnit, Mocha, WebDriver, YUI Test, BusterJS, FuncUnit, Robot Framework, and many others are supported.
  • Page automation. Access and manipulate web pages with the standard DOM API, or with usual libraries like jQuery.
  • Screen capture. Programmatically capture web contents, including CSs, SVG and Canvas. Build server-side web graphics apps, from a screenshot service to a vector chart rasterizer.
  • Network monitoring. Automate performance analysis, track page loading and export as standard HAR format.

Features

  • Multiplatform, available on major operating systems: Windows, Mac OS X, Linux, other Unices.
  • Fast and native implementation of web standards: DOM, CSS, JavaScript, Canvas, SVG. No emulation!
  • Pure headless (no X11) on Linux, ideal for continuous integration systems. Also runs on Amazon EC2, Heroku, Iron.io.
  • Easy to install: Download, unpack, and start having fun in just 5 minutes.

Ecosystem

PhantomJS needs not be used only as a stand-alone tool. Check also some excellent related projects:

  • CasperJS enables easy navigation scripting and common high-level testing.
  • Poltergeist allows running Capybara tests headlessly.
  • Guard::Jasmine automatically tests Jasmine specs on Rails when files are modified.
  • GhostDriver complements Selenium tests with a PhantomJS WebDriver implementation.
  • PhantomRobot runs Robot Framework acceptance tests in the background via PhantomJS.
  • Mocha-PhantomJS run Mocha tests using PhantomJS.

and many others related projects.

Questions?

PhantomJS is free software/open source, and is distributed under the BSD license. It contains third-party code, see the included third-party.txt file for the license information on third-party code.

PhantomJS is created and maintained by Ariya Hidayat (Twitter: @ariyahidayat), with the help of many contributors.