Commit Graph

62 Commits (a445b2d7b9e10379c9679885988f9ad30ce365b1)

Author SHA1 Message Date
execjosh a445b2d7b9 Migrate network access manager settings to PhantomConfig 2011-08-27 03:02:51 +09:00
execjosh 5441f51607 Migrate proxy settings to PhantomConfig 2011-08-27 03:02:43 +09:00
execjosh a75f7c9dc3 Create PhantomConfig and migrate output and script encoding settings 2011-08-27 03:02:35 +09:00
Ariya Hidayat 6fe972d0a8 Implement WebPage's release() function in pure C++. 2011-08-23 18:53:53 -07:00
IceArmy fb93d49a7f Rename page.destroy() to page.release() 2011-08-21 14:12:15 -07:00
Ariya Hidayat 34a7389a2c Make Terminal class a real singleton. 2011-08-21 00:47:34 -07:00
Ariya Hidayat 944056ce4a Remove unused m_convert from Phantom class. 2011-08-20 23:52:23 -07:00
IceArmy 8880edcf78 Remove settings: jsOpenWindows, jsAccessClipboard, siteSpecificQuirksMode
Renamed jsEnabled to javascriptEnabled
2011-08-20 16:49:36 -07:00
IceArmy 33005c3957 Add a few new QWebSettings for page settings.
Among the most useful, is the jsEnabled setting, which allows you to disable JavaScript.
2011-08-19 15:47:34 -07:00
execjosh 4e7d3f1c18 Change javascript property from "encoding" to "outputEncoding" 2011-08-17 04:17:42 +09:00
execjosh 682b3532be Add command-line option to set encoding of starting script 2011-08-17 03:53:56 +09:00
execjosh 6254c84717 Add command-line option to set terminal output encoding 2011-08-17 03:49:12 +09:00
execjosh ca92c9ff84 Allow startup script to set output encoding 2011-08-17 03:18:52 +09:00
execjosh dc72101c10 Replace direct usage of stdout and stderr with terminal 2011-08-17 03:15:02 +09:00
Erik Dubbelboer b1d947dd51 added persistent cookie support 2011-07-19 19:32:42 +02:00
IceArmy 895923603f Fix memory issues by providing a way to truly delete WebPages. #154
Use page.destroy() to delete the page and regain the memory.
2011-07-02 17:08:06 -07:00
Alessandro Portale c86d104c83 Remove obsolete #include <gifwriter.h> 2011-06-30 05:15:43 +02:00
Ariya Hidayat da749624a3 Merge pull request #99 from aportale/Issue_148
Fix crash on exit (Issues #136, #148 and #149)
2011-06-28 18:05:40 -07:00
Alessandro Portale 5acaa6b42d Fix crash on exit (Issues #136, #148 and #149)
Workaround: Apparently, all QWebPages need to be deleted before
the QApplication gets destroyed.
2011-06-29 00:45:12 +02:00
Ivan De Marino a0e1888c2c Moved the "fs" object to be in the global/window space: will not be attached to the "phantom" object anymore.
* Once (and if) we implement support for CommonJS Module Loading, a "require("fs")" will be required.
2011-06-28 21:02:48 +01:00
Ivan De Marino 6b04ee23c1 Introducing File I/O API in PhantomJS.
* This is the  squash of 30 commits, so it's meaty
* Inspired by HammerJS (see https://github.com/senchalabs/hammerjs)
* Not yet 100% complete
* Final aim is to provide a CommonJS/Filesystem compliant API (see http://wiki.commonjs.org/wiki/Filesystem)
2011-06-27 23:14:05 +01:00
Ariya Hidayat f25a7a66e5 Bump the Qt requirement to version >= 4.6.
Also, remove code branch for Qt 4.5.
2011-06-26 21:51:30 -07:00
Ivan De Marino 2895d096ab Adding "--local-access-remote=[yes|no]".
* This will allow local content to access remote content, bypassing the same origin policy.
* It's controllable from the CLI and through the "page.settings" property
* This addresses Issue #28 but only partially: it's still not possible to make _remote content access other remote content on a different origin_.
2011-06-24 15:57:55 +01:00
Ariya Hidayat 8094cdb4e7 Make sure phantom.exit() really exits.
Patch by Alessandro Portale.
2011-06-20 23:24:51 -07:00
IceArmy 69b06da140 Revert "Exit program properly when we call phantom.exit" 2011-06-20 10:14:08 -07:00
Ariya Hidayat 7ba0d6964e Merge pull request #82 from Roejames12/master
Exit program properly when we call phantom.exit
2011-06-19 23:19:44 -07:00
Ariya Hidayat 00810e98b3 Pass source and lineNumber for console redirection.
onConsoleMessage callback can handle two (optional) arguments, e.g.

    page.onConsoleMessage = function (msg, lineNo, source) {
        ....
    };
2011-06-19 21:06:27 -07:00
IceArmy c44838227d Fix bug where phantom.exit wouldn't exit properly 2011-06-19 17:26:39 -07:00
IceArmy 0e765f2a95 Exit program properly when we call phantom.exit
Previously, calling phantom.exit would set the exit code and finish running the
JavaScript until it was done, then exit the program with your code. Basically
it didn't actually exit the program. It caused many code fallthrough problems,
but is now fixed. :)
2011-06-19 01:20:45 -07:00
IceArmy ff3eb34fc1 Maintain consistency across error messages 2011-06-18 00:27:59 -07:00
Ariya Hidayat 6e2b362850 Change scriptLookupDir to libraryPath. 2011-06-17 20:52:19 -07:00
Ariya Hidayat 12c81516cc Never continue if terminated is flagged. 2011-06-17 20:52:13 -07:00
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