Commit Graph

455 Commits (944afb314e146b8424f29145677ed44c1373abbf)

Author SHA1 Message Date
Ivan De Marino cc45aa7f38 Normalie user-provided script path 2011-06-10 17:08:46 +01:00
Ivan De Marino 75403737c4 Added "includeJs()" to "page".
* It includes a script in the page
* It uses a callback to ensure any code dependent on the include runs afterwards
* It uses the signal "javaScriptAlertSent" to do the trick (is there another way to be notified of the "onLoad" event from outside the page context?)
* It uses a "private" slot "_appendScriptElement" to pass the script url in the page context (is there a better way?)
2011-06-10 17:08:46 +01:00
Ivan De Marino 11c8322718 Renaming "page.handlers" to "page._handlers": more common for "private" stuff. 2011-06-10 17:08:46 +01:00
Ivan De Marino a0f8f2491d "loadJsFile()" -> "injectJs"
* According to Issue #32 (http://code.google.com/p/phantomjs/issues/detail?id=32) I added a "lookup logic" that searchs for the file following those steps:
*# Search for file at given path (relative to PWD or absolute - no difference)
*# Is file there? Inject it
*# Is file not there? Try looking for it in "scriptLookupDir"
*# Is file there? Inject it
*# Is file not there? abort
* "scriptLookupDir" is an extra property for WebPage, that, as by it's name, defines a place where to look to script to inject
* Script can alter the scriptLookupDir, if they want
* Updated "injectme.js" accordingly
2011-06-10 17:08:45 +01:00
Ivan De Marino 52677f4f01 Removing "page.click()" for now.
There is need for a discussion to decide how to do this.
2011-06-10 16:53:11 +01:00
Ivan De Marino bf3aa06e19 More work on "injectJs"
* "injectJs()" now supports ".coffee" input
* "injectJs()" is now available for the "phantom" object as well
* CSConverter is now a singleton embedded in the Utils static class
* The code used by "injectJs()" is now centralised in the Utils static class
2011-06-10 16:50:49 +01:00
Ivan De Marino 7a4ea47c1d Normalie user-provided script path 2011-06-09 18:07:37 +01:00
Ivan De Marino 7be25c9a13 Added "includeJs()" to "page".
* It includes a script in the page
* It uses a callback to ensure any code dependent on the include runs afterwards
* It uses the signal "javaScriptAlertSent" to do the trick (is there another way to be notified of the "onLoad" event from outside the page context?)
* It uses a "private" slot "_appendScriptElement" to pass the script url in the page context (is there a better way?)
2011-06-09 16:11:39 +01:00
Ivan De Marino e5a1f32193 Merge branch 'utilities' of https://github.com/detro/phantomjs into utilities 2011-06-09 11:58:49 +01:00
Ivan De Marino bb0b820f72 Merge remote-tracking branch 'upstream/master' into utilities 2011-06-09 11:50:54 +01:00
Ariya Hidayat 9d12d35478 Merge pull request #69 from Roejames12/master
Latest updates
2011-06-09 01:39:28 -07:00
IceArmy 0bfd28e67d example/netsniff.coffee: Format the output to HAR 1.2 specification. 2011-06-09 00:58:03 -07:00
IceArmy 6a8da550cb Better timing for onResourceRequested and onResourceReceived.
We record the time right inside the network access manager. This gives
better accuracy than doing it from JavaScript side, no loss due to the
latency of signal slot connection.
2011-06-09 00:30:55 -07:00
IceArmy 5ca07d99ba Expose more properties for onResourceRequested and onResourceReceived. 2011-06-09 00:30:55 -07:00
Ariya Hidayat c2c6cbc287 example/netsniff.js: Format the output to HAR 1.2 specification. 2011-06-08 23:47:14 -07:00
Ariya Hidayat 751e471068 Better timing for onResourceRequested and onResourceReceived.
We record the time right inside the network access manager. This gives
better accuracy than doing it from JavaScript side, no loss due to the
latency of signal slot connection.
2011-06-08 23:32:14 -07:00
Ariya Hidayat dd8344f041 Expose more properties for onResourceReceived event. 2011-06-08 23:28:54 -07:00
Ariya Hidayat f615fce1e9 Merge pull request #68 from Roejames12/master
Updates!
2011-06-08 20:26:30 -07:00
IceArmy 3c665681f4 Fix possible bug where if CoffeeScript starts with a shebang (hashbang) #!, then // gets put in front of it; but this is not a comment in CoffeeScript, so it causes a problem with the conversion. 2011-06-08 19:00:07 -07:00
IceArmy 91ceec1e9b Add a unique id to associate resource request and receive. 2011-06-08 14:34:30 -07:00
Ariya Hidayat 555f80c899 onResourceReceived with stage=start should fire only once.
We detect if stage=start has been fired before. If yes, no need to
fire again, thus making the event is associated with the very
first byte received for the given resource.
2011-06-08 07:57:51 -07:00
Ariya Hidayat 5b2fdca640 Add a unique id to associate resource request and receive. 2011-06-08 07:54:28 -07:00
Ariya Hidayat 615ac6efa9 Merge pull request #67 from Roejames12/master
Updates..
2011-06-08 06:16:35 -07:00
IceArmy 15e596e30c Add hook to handleStarted() 2011-06-08 04:58:20 -07:00
IceArmy d4548b9ad9 Transform all yes,no args into True,False in parseArgs() 2011-06-08 03:14:13 -07:00
IceArmy f0801ad356 Regenerate resources 2011-06-08 03:14:13 -07:00
IceArmy 5c6338c060 Remove encode() from utils.py 2011-06-08 03:14:13 -07:00
IceArmy 0e3b765cc4 Add 'onResourceReceived' event, fired when resource is being received. 2011-06-08 03:13:18 -07:00
Ariya Hidayat 1cae77a3e0 Add 'onResourceReceived' event, fired when resource is being received.
This is now being used in the netsniff.js example.
2011-06-08 01:10:00 -07:00
Ivan De Marino 60793e4c6b Renaming "page.handlers" to "page._handlers": more common for "private" stuff. 2011-06-07 23:39:12 +01:00
Ivan De Marino ce0577adff "loadJsFile()" -> "injectJs"
* According to Issue #32 (http://code.google.com/p/phantomjs/issues/detail?id=32) I added a "lookup logic" that searchs for the file following those steps:
*# Search for file at given path (relative to PWD or absolute - no difference)
*# Is file there? Inject it
*# Is file not there? Try looking for it in "scriptLookupDir"
*# Is file there? Inject it
*# Is file not there? abort
* "scriptLookupDir" is an extra property for WebPage, that, as by it's name, defines a place where to look to script to inject
* Script can alter the scriptLookupDir, if they want
* Updated "injectme.js" accordingly
2011-06-07 23:22:41 +01:00
Ariya Hidayat ea62c17b91 Fix typo, it's C5E and not CSE. 2011-06-07 11:27:10 -07:00
Ariya Hidayat 1286e99e35 Merge pull request #66 from Roejames12/master
Some updates
2011-06-07 11:18:50 -07:00
IceArmy 81627896c2 Support every possible PDF format 2011-06-07 10:57:08 -07:00
IceArmy f419a958a4 Make build_binary.py able to import no matter what 2011-06-07 09:34:07 -07:00
Ivan De Marino 5b6f2731c4 Added support for "page.click()" and "page.loadJsFile()".
* click() accepts a "querySelectorAll" input - can click on multiple things in one call
* loadJsFile() is synchronous at loading JS in the page
* added 2 examples in JavaScript to show how to use (and test) the new methods
* NOTE: someone will have to generate the .coffee version - I tried using "http://ricostacruz.com/js2coffee/" but it hangs and I'm not willing to learn why :P - I don't like Coffee Script.
2011-06-07 17:20:22 +01:00
Ariya Hidayat d1973c28f3 Merge pull request #64 from Roejames12/master
More updates..
2011-06-07 08:35:28 -07:00
IceArmy 805c824ff3 Convert netsniff.js to CoffeeScript 2011-06-07 02:52:01 -07:00
IceArmy 33f0930d8c Regenerate resources 2011-06-07 02:32:12 -07:00
IceArmy 48704069c2 Enumerate all headers in the HTTP request. 2011-06-07 02:32:12 -07:00
IceArmy 4b3cf65b2e Get away with manual qDebug() since we can use the API now. 2011-06-07 02:32:12 -07:00
IceArmy 8314ad3197 Add "onResourceRequested" event, fired when request is started.
To see how this is being used, see the new examples/netsniff.js.

http://code.google.com/p/phantomjs/issues/detail?id=2
2011-06-07 02:31:33 -07:00
IceArmy 150b33211f Merge branch 'master' of https://github.com/ariya/phantomjs 2011-06-07 01:09:10 -07:00
Ariya Hidayat 4dfe70f620 Enumerate all headers in the HTTP request. 2011-06-07 00:19:12 -07:00
Ariya Hidayat a0ab4f798e Get away with manual qDebug() since we can use the API now. 2011-06-07 00:14:01 -07:00
Ariya Hidayat 8722399c0a Add "onResourceRequested" event, fired when request is started.
To see how this is being used, see the new examples/netsniff.js.

http://code.google.com/p/phantomjs/issues/detail?id=2
2011-06-07 00:06:08 -07:00
Ariya Hidayat cf8a890f8b loadspeed.js: Fixed missing semicolons. 2011-06-06 23:52:39 -07:00
IceArmy 189703cffc rename setup.py (for building binaries) to build_binary.py 2011-06-06 23:09:06 -07:00
IceArmy ce27e879a2 Setup setup.py information 2011-06-06 22:46:05 -07:00
IceArmy 5f66b1c32b Add AUTHORS file for contributors 2011-06-06 22:31:36 -07:00