1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-09-11 04:46:09 +03:00
phantomjs/examples
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
..
arguments.coffee Update examples to use system.args. 2012-03-15 01:11:30 -07:00
arguments.js Update examples to use system.args. 2012-03-15 01:11:30 -07:00
colorwheel.coffee Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
colorwheel.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
countdown.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
countdown.js Ported 'countdown.js' to PhantomJS 1.2 2011-06-01 14:25:22 +01:00
detectsniff.coffee Fix potential hang in the example scripts due to missing exit() call. 2012-12-16 23:02:44 -08:00
detectsniff.js Fix potential hang in the example scripts due to missing exit() call. 2012-12-16 23:02:44 -08:00
direction.coffee Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
direction.js Update examples to use system.args. 2012-03-15 01:11:30 -07:00
echoToFile.coffee Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
echoToFile.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
features.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
features.js examples/feature.js: Show supported/unsupported features. 2011-06-26 14:05:48 -07:00
fibo.coffee Indent with 2 spaces. 2011-05-29 14:21:25 +02:00
fibo.js Remove phantom.log, just use the de-facto console.log for logging. 2010-12-31 20:10:34 -08:00
follow.coffee Adding 'WebPage#close' calls where appropriate in example scripts. 2012-12-06 08:27:06 -08:00
follow.js Adding 'WebPage#close' calls where appropriate in example scripts. 2012-12-06 08:27:06 -08:00
hello.coffee Start to implement support for CoffeeScript. 2011-03-02 00:59:07 -08:00
hello.js Remove phantom.log, just use the de-facto console.log for logging. 2010-12-31 20:10:34 -08:00
imagebin.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
imagebin.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
injectme.coffee Merge pull request #155 from Roejames12/master 2011-09-14 21:45:08 -07:00
injectme.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
ipgeocode.coffee Indent with 2 spaces. 2011-05-29 14:21:25 +02:00
ipgeocode.js Remove phantom.log, just use the de-facto console.log for logging. 2010-12-31 20:10:34 -08:00
loadspeed.coffee Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
loadspeed.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
modernizr.js examples/feature.js: Show supported/unsupported features. 2011-06-26 14:05:48 -07:00
module.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
module.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
movies.coffee Indent with 2 spaces. 2011-05-29 14:21:25 +02:00
movies.js Remove phantom.log, just use the de-facto console.log for logging. 2010-12-31 20:10:34 -08:00
netlog.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
netlog.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
netsniff.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
netsniff.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
outputEncoding.coffee Add examples for phantom.outputEncoding 2011-08-25 03:15:26 +09:00
outputEncoding.js Add examples for phantom.outputEncoding 2011-08-25 03:15:26 +09:00
page_events.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
page_events.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
pagecallback.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
pagecallback.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
phantomwebintro.coffee Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
phantomwebintro.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
pizza.coffee Update examples/pizza.coffee. 2012-12-16 14:20:57 -08:00
pizza.js Fix examples/pizza.js. 2012-12-16 14:19:57 -08:00
post.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
post.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
postserver.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
postserver.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
printenv.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
printenv.js printenv.js: New example to show system.env. 2012-03-15 01:33:27 -07:00
printheaderfooter.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
printheaderfooter.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
printmargins.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
printmargins.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
rasterize.coffee Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
rasterize.js Fix potential hang in the example scripts due to missing exit() call. 2012-12-16 23:02:44 -08:00
render_multi_url.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
render_multi_url.js Adding 'WebPage#close' calls where appropriate in example scripts. 2012-12-06 08:27:06 -08:00
run-jasmine.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
run-jasmine.js Non-zero exit code if any test fails. 2012-09-21 00:12:52 -07:00
run-qunit.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
run-qunit.js Update examples to use system.args. 2012-03-15 01:11:30 -07:00
scandir.coffee Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
scandir.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
seasonfood.coffee Indent with 2 spaces. 2011-05-29 14:21:25 +02:00
seasonfood.js Remove phantom.log, just use the de-facto console.log for logging. 2010-12-31 20:10:34 -08:00
server.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
server.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
serverkeepalive.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
serverkeepalive.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
simpleserver.coffee Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
simpleserver.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
sleepsort.coffee Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
sleepsort.js Fixed missing exit code when errornous. 2012-05-17 23:35:02 -07:00
stdin-stdout-stderr.coffee Implement CommonJS IO/A read([n Number]) 2012-12-25 20:46:14 -08:00
stdin-stdout-stderr.js Implement CommonJS IO/A read([n Number]) 2012-12-25 20:46:14 -08:00
technews.coffee Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
technews.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
tweets.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
tweets.js Use the new Twitter handle for the examples. 2012-07-15 02:13:35 -07:00
universe.js Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
unrandomize.coffee Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
unrandomize.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
useragent.coffee Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
useragent.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
version.coffee Indent with 2 spaces. 2011-05-29 14:21:25 +02:00
version.js Provide an API to get PhantomJS version. 2011-01-01 08:29:03 -08:00
waitfor.coffee Added CoffeeScript examples where missing, minor other fixes 2012-12-06 14:29:37 -06:00
waitfor.js Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
walk_through_frames.coffee Adding the ability to switch between frames. 2012-06-15 00:07:53 -07:00
walk_through_frames.js Adding the ability to switch between frames. 2012-06-15 00:07:53 -07:00