Commit Graph

30 Commits (944afb314e146b8424f29145677ed44c1373abbf)

Author SHA1 Message Date
Ariya Hidayat 944afb314e Do not crash when the command line option is unknown.
http://code.google.com/p/phantomjs/issues/detail?id=124
2011-06-17 18:37:01 -07:00
Ariya Hidayat 75bbbebb89 Simplify the logic inside Phantom::execute().
We need to make sure we return quickly if terminated is set to false
(e.g. in the constructor, if something is wrong).
2011-06-17 18:04:20 -07:00
IceArmy 61459fab45 Use phantom.scriptName instead of phantom.args[0] 2011-06-15 14:30:31 -07:00
IceArmy c8c58f11c7 Pass script's filename as arg[0] 2011-06-15 02:57:14 -07:00
IceArmy 309d3b5aaa Allow scriptLookupDir to be set for phantom object 2011-06-12 14:38:34 -07:00
IceArmy 25ac6d35ca phantom.injectJs should use the starting scripts directory, not the app directory 2011-06-12 14:04:07 -07:00
Ivan De Marino bd18d7c838 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 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
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
Ariya Hidayat c68762dc9d Add --version command-line option. 2011-06-06 00:36:31 -07:00
Ariya Hidayat 1d9c349265 Make exit() synchronous.
We might still need to find a workaround if this crashes on Windows
(see commit bb355db6).
2011-05-29 00:20:56 -07:00
Ariya Hidayat 5be29972cf WebPage callback for its console message.
See http://code.google.com/p/phantomjs/issues/detail?id=12.

By default, WebPage is "silent" and does not report its console message.
This can be overridden easily, e.g:

  var page = new WebPage();
  page.onConsoleMessage = function (msg) {
    console.log(msg);
  };
  page.open(.....);
2011-05-28 21:16:18 -07:00
Ariya Hidayat 7e099abaf2 User-agent is part of WebPage settings, not WebPage object itself. 2011-05-27 22:50:33 -07:00
Ariya Hidayat 2a46ccde8b WebPage object can have settings. 2011-05-27 22:36:34 -07:00
Ariya Hidayat b8fc6558a2 Bring back load-images and load-plugins option. 2011-05-27 20:39:09 -07:00
Ariya Hidayat f5e070d444 Store bootstrap code in its own file. 2011-05-26 02:18:09 -07:00
Ariya Hidayat a65ae9b1a8 Reenable custom network access manager. 2011-05-26 01:56:43 -07:00
Ariya Hidayat 9a2fd4b361 Bring back some default web page settings. 2011-05-26 00:27:55 -07:00
Ariya Hidayat df64f60ec9 Use WebPage, not QWebPage, inside Phantom class. 2011-05-25 14:00:20 -07:00
Ariya Hidayat d15e097815 Refactor most of functionalities to WebPage object.
This breaks all examples (will be fixed slowly). Some features, e.g.
file upload, are also still regressed.
2011-05-25 10:49:35 -07:00
Peter Jihoon Kim 57f525a78a added option: --ignore-ssl-errors=[yes|no] 2011-04-29 16:32:40 +08:00
Ariya Hidayat 710e947ac7 Fix issue 93: build with Qt 4.5.
Guard some Qt >= 4.6 features in version checks.
2011-04-18 22:50:27 -07:00
IceArmy 6fdc9d11f5 Allow setting clipRect to height:0, width:0, which will 'reset' the clipRect 2011-04-13 02:08:33 -07:00
Jon Turner 0e1e5071fb Added option for disk cache use 2011-04-12 15:21:09 +01:00
Ariya Hidayat 7280e6d5c6 For the moment, remove simulateMouseClick, includeJS, and loadJS.
See http://code.google.com/p/phantomjs/issues/detail?id=32 and
http://code.google.com/p/phantomjs/issues/detail?id=41.
2011-04-09 22:40:36 -07:00
Ariya Hidayat c0ea3d8732 Preserve last year copyright. 2011-04-09 22:37:06 -07:00
Ivan De Marino be72a29c9f Propagated License Headers. 2011-04-09 18:34:04 +01:00
Ivan De Marino 6ec8b3b669 New "shim" Network Access Manager, new 'browsermode' example and more.
The new Network Access Manager currently is designed to do just logging:
- logs HTTP Method type
- logs HTTP Destination URL

The new 'browsermode':
It's in "/examples" and make PhantomJS do just a call to "open(url)".
It has a companion shell script to help with the task.

Also, improvement for Message Handler:
messages are now prefixed with ISO Datetime.
2011-04-09 18:22:52 +01:00
Ivan De Marino c616205620 Added a Qt Message Handler (finally). 2011-04-08 15:49:20 +01:00
Ivan De Marino a45b8e8401 Major refactoring of the CPP code into separate classes.
This doesn't add ANY new feature: it's aimed only at separating code into
more manageable pieces.

Maybe it's not perfect yet, but it's a start.
2011-04-08 14:30:50 +01:00