Commit Graph

99 Commits (119e1ba516deee21bcf91c6c5f276b6df950cd24)

Author SHA1 Message Date
Ariya Hidayat 119e1ba516 Implement the plumbing for CommonJS System module support.
See http://wiki.commonjs.org/wiki/System.

Based on the initial work from execjosh:
https://github.com/ariya/phantomjs/pull/192

http://code.google.com/p/phantomjs/issues/detail?id=270
2012-03-14 23:23:43 -07:00
Ariya Hidayat c12f1aab4a Control web security setting.
This is through --web-security command-line option and
webSecurityEnabled configuration setting.

When web security is off (disabled), universal access to any location
from any document is granted. Use it with caution!

Patch by Danny Wang <wangyang0123@gmail.com>.
Originally from https://github.com/ariya/phantomjs/pull/212.

http://code.google.com/p/phantomjs/issues/detail?id=28
2012-03-12 23:37:50 -07:00
Stephen Young 7615582e0c Proxy authentication support.
This is through --proxy-auth command-line option and proxyAuth
configuration setting.

http://code.google.com/p/phantomjs/issues/detail?id=105
2012-03-12 20:51:14 -07:00
Ariya Hidayat 775c94942d Do not use module include.
For the same reason like in previous commit 685c5f5725: with our
minimalistic copy of Qt, the module header might be incomplete.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-09 07:42:53 -08:00
Ariya Hidayat 685c5f5725 Qt import: Don't use module include.
In the current state of our imported minimalistic Qt, some header files
are missing. Since the module include like <QtGui> just includes
everything, this leads to a preprocessor error.

The solution is to include only needed headers from particular class.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-06 18:44:19 -08:00
Ivan De Marino 61a3bf9021 A REPL for PhantomJS
This covers [Issue 252](http://code.google.com/p/phantomjs/issues/detail?id=252)

The commit is composed of 12 squashed commits:

commit efdc6ba4f143c30a690fd97d92d80fa412e79999
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Mon Feb 27 00:19:36 2012 +0000

    Pretty-pringing and Completion Caching done!

    * This completes pretty-printing for the result of evaluated
    * expressions in the REPL.
    * Also, now we cache the "possible completions", to speed things up
    * a bit (nothing fancy though).
    * Minor tweaks to the internal doc and the way we "mock"
    * pretty-printing for QObjects/REPLCompletanle
    * All tests passing :)

commit 1f9ef690e112a535b431fca409b77bb9c09d1c70
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Sun Feb 26 22:35:00 2012 +0000

    Moving most of REPL shim JavaScritp code in a separate file. Way
easier to work on.

commit 02d460a16fee14e7096ae7d899c03902c5b8a9c6
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Sat Feb 25 20:25:18 2012 +0000

    Initialisation of the Completions is now done in a pure virtual.

    This means that every REPLCompletable object will ACTUALLY register
completion strings, ONLY if we are running a REPL
    and that object is ACTUALLY created.
    Otherwise, why bother?

    Adding completions for all exposed REPLCompletable objects

    Also, fixed an issue with _getCompletions()

commit 412c3778fb04aa1c7379f8e760afce702b0428dd
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Tue Feb 21 00:49:17 2012 +0000

    Few more tweaks to the REPL:

    - Now 'phantom' is the first QObject with proper completion
    - No repetition in QObject completions
    - LVAL of any user expression is now correctly prettified and
      printed

    Major things left to do:

    - Cache completions (using QCache?)
    - Add completions for the other QObject
    - When the LVAL of a user expression is a QObject, print what's
      expected, not the QObject "real" structure

commit 46f04713c8165d898055e15478bb31403f8c93f1
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Tue Feb 7 10:13:23 2012 -0800

    Pretty-print expressions result

    Still not done though: there are issues with the NON-Native JS
objects.

commit 98b2fe67651dc750b62c6fa9cf1d80317fd9ae06
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Fri Feb 3 00:22:52 2012 -0800

    Introducing REPLCompletable.

    This class should be inherited by any JavaScript-exposed QObject, to
ensure correct Auto-Completion.

    Correct auto-completion for QObjects.

    - Now even QObjects can correctly provide auto-completion, and avoid
      showing "not for users" methods
    - The strings used for the auto-completion are stored in a single
      Index: minimum memory footprint
    - Still, there is optimization that should be done (when "searching"
      for the right completion by prefix)
    - Completion for the objects not set up yet, but now it's just a
      trivial sequence of "addCompletion('bla')" in their constructors

commit 9bd48618154b1530a37b41f4060440184e23253d
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Thu Feb 2 00:20:25 2012 -0800

    Changing the way we import Linenoise.

    Will just import a specific commit, and update manually when needed.

commit cfc9bae9fbdab13b01019b34b7cbd565e3153780
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Sun Jan 29 23:22:26 2012 -0800

    Made the REPL into a Singleton. With Auto-completion!.

    Reasons:
    1) Needed a pointer to function (i.e. a static method) to be used
with Linenoise to provide auto-completions
    2) It makes more sense, as it's not like we are going to have 2 REPL
running at the same time, are we?

    There are problems to address:
    - the enumeration in JS seems to return only the native interface of
      our objects
    - the function completions contain argument types of those functions
    - "private" methods are exposed

commit c78bd32e17f8e0e4cc4a0066858de8cc81d33b97
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Sun Jan 29 22:10:20 2012 -0800

    Migrating from the original, now [unmantained
Linenoise](https://github.com/antirez/linenoise) to the fairly active
[tadmarshall fork](https://github.com/tadmarshall/linenoise).

    Also now the project is imported as a Git Submodule.
    Having migrated to the latest Linenoise (see prev. commit), now this
_SHOULD_ work on Windows too.
    But, of course, this needs testing. :)

commit 43713c5723d7c5ed446ba41ae8d6f8c9feba7f9b
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Tue Jan 24 23:17:06 2012 -0800

    Now that the basics work, I'm adding support for REPL history.

    This is something almost everyone today is accustomed to.
    Also, now REPL history works!
    And I found some useful resources to solve pending TODOs.

commit 31e5f88b044a5b4a823c67527ef8c245d2ac7863
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Sun Jan 22 20:56:36 2012 -0800

    Adding Linenoise Project (https://github.com/antirez/linenoise).

    For now is included as a drop-in set of files.
    Later on, if the Linenoise project has frequent
    updates, we might prefer to do it as a
    git-submodule.

commit 4be9c15c65db4767e482fba0be13f8aab286d5f3
Author: Ivan De Marino <ivan.de.marino@gmail.com>
Date:   Thu Jan 5 15:31:13 2012 +0000

    First simple REPL implementation.

    - Not complete
    - Still doesn't handle arrow keys (needed for history)
2012-03-04 21:33:08 -08:00
Jon Leighton e88e008ecf Add option to specify whether or not the remote debugger should autorun.
http://code.google.com/p/phantomjs/issues/detail?id=399
2012-02-28 07:46:09 -08:00
Jon Leighton d17bf8c825 Enable remote web inspector on sub-pages.
Currently trying to use the remote debugger with sub-pages created in
the phantomjs session will result in a segfault inside QtWebKit. With
this patch, it works.

http://code.google.com/p/phantomjs/issues/detail?id=6
2012-02-28 07:41:19 -08:00
Baffo32 5a53b7ad55 Provide an initial base URL for the root webpage so it is not sandboxed.
This resolves for me http://code.google.com/p/phantomjs/issues/detail?id=257.
2012-02-18 21:33:03 -08:00
Antono Vasiljev 8f08d54b13 Fix version number
1.5 (development) (development) -> 1.5 (development)

  koz it's wrong and also breaks guard-jasmine version parser
2012-01-12 03:06:25 -08:00
execjosh 12504321e1 Add conventional "--help" option
Most command-line programs provide an option to display the usage
message.  Currently, this is achieved by passing no options at all.
This change allows for a more intuitive way for users to check the
list of available options.

http://code.google.com/p/phantomjs/issues/detail?id=347
2012-01-12 03:02:46 -08:00
Ivan De Marino 4fd7fb9d40 Fixing what seems like a "copy & paste went wrong".
The parameter "startingScript" was never used, and I think it comes from the sibling method "injectJsInFrame".
2012-01-04 16:56:31 +00:00
Ariya Hidayat 446abdbd7e Fix wrong exit code (regression).
http://code.google.com/p/phantomjs/issues/detail?id=294
2011-12-19 17:53:39 -08:00
Ariya Hidayat ac95479424 Merge pull request #166 from jgornick/add-socks5-proxy
Added ability to specify SOCKS5 proxy type.

http://code.google.com/p/phantomjs/issues/detail?id=266
2011-11-21 20:47:56 -08:00
Leo Franchi 610fb41922 Add support for remotely debugging a script.
This adds a new parameter --remote-debugger-port=<port>. When set,
phantomjs is operating in debug mode and will expose a webkit remote
debugger on the desired port. It can be attached to from any WebKit
browser on the given port and debugged.
2011-11-15 19:02:06 -05:00
Milian Wolff 73705e484b first work towards a WebServer
this is the minimal server that gets properly embedded into
the phantomjs space but the .listen api is missing actually
useful options (incoming request and ability to write to client)
2011-11-15 13:44:47 +01:00
Joe Gornick cd9f40b22d Merge branch 'master' of git://github.com/ariya/phantomjs into add-socks5-proxy 2011-11-08 23:23:28 -06:00
Joe Gornick d91c5af9b2 Added ability to specify SOCKS5 proxy type. 2011-11-08 21:58:48 -06:00
Ivan De Marino 19b32cff0a Refactored and Centralised how we handle the loading of resource files.
* Some code reuse
* Centralised in Utils the loading of resource files
* It is safe to assume, when loading a resource file, that IT'S THERE and IT'S READABLE
* ALSO, I removed the unused 'shims' (we forgot them in there :P)
2011-10-16 20:35:21 +01:00
Ariya Hidayat b0a5b6dbad Every web page gets its own network access manager.
Network-related activites should not be shared between web page
instances. Otherwise, it is extremely confusing when there are two (or
more) web pages are active at the same time.

http://code.google.com/p/phantomjs/issues/detail?id=190
2011-09-14 23:46:01 -07:00
Ariya Hidayat 7a9b6b4fec Clean-up WebPage constructor.
We shall just pass the Config instance, that's cleaner and less messy.

This is a preparation step for
http://code.google.com/p/phantomjs/issues/detail?id=190
2011-09-14 21:47:36 -07:00
Ariya Hidayat e960279ff2 Coding style: fix place bracement. 2011-09-11 02:19:20 -07:00
Ariya Hidayat b6102d7f6e Refactoring on the module implementation.
This is mostly based on Ivan's work, see
https://github.com/ariya/phantomjs/pull/153

http://code.google.com/p/phantomjs/issues/detail?id=47
2011-09-11 01:04:53 -07:00
Ariya Hidayat 4fb37aa0cc Create FileSystem instance only when needed. 2011-09-08 17:37:01 -07:00
Ariya Hidayat 2b83a52251 Implement require('webpage').
This is mostly based on Ivan's work, see
https://github.com/ariya/phantomjs/pull/153

window.WebPage still works, it is not recommended and will be
deprecated.

http://code.google.com/p/phantomjs/issues/detail?id=47
2011-09-08 17:32:31 -07:00
Ariya Hidayat 6a79ea7e6d Implement require('fs').
This is mostly based on Ivan's work, see
https://github.com/ariya/phantomjs/pull/153

http://code.google.com/p/phantomjs/issues/detail?id=47
2011-09-08 10:00:07 -07:00
Ariya Hidayat 059e72588c Rename option/config to localToRemoteUrlAccess(Enabled). 2011-09-07 09:27:20 -07:00
Ariya Hidayat cebe64ec31 Config to limit the disk cache size.
Based on the previous patch at https://github.com/ariya/phantomjs/pull/144.

http://code.google.com/p/phantomjs/issues/detail?id=220
2011-09-06 16:33:11 -07:00
Ariya Hidayat 7cd76309e6 Merge pull request #151 from detro/dev-commonjs_fileio
Last API
2011-09-04 21:19:15 -07:00
Ivan De Marino 8c15c80b14 Renamed "fs-shim.js" to "fileystem-shim.js" to ensure name consistency. 2011-09-04 21:26:11 +01:00
mintbridge af71868c23 add basic http auth support to networkaccessmanager, and add the ability to pass the auth credentials in from the command line 2011-09-02 16:35:58 +01:00
Ivan De Marino 715f1a7fc3 Refactored the JS Shims to be isolated in their own file.
Also, refactored some "too cautious" code to load the shim.

PS I don't grasp 100% the point of "Terminal". Wouldn't qDebug() be enough? What am I missing?
2011-09-01 18:06:30 -07:00
Ivan De Marino 3401dd9f78 Refactored the JS Shims to be isolated in their own file.
Also, refactored some "too cautious" code to load the shim.

PS I don't grasp 100% the point of "Terminal". Wouldn't qDebug() be enough? What am I missing?
2011-08-31 23:19:17 +01:00
Ariya Hidayat 8ebd446e58 Merge pull request #145 from detro/master
Comments stuff
2011-08-31 09:27:52 -07:00
Ivan De Marino d8d88a3894 Added "Copyright..." line to files on which I worked on.
I tried to also add/remove based on the git history.
2011-08-31 16:29:40 +01:00
execjosh 3c790d80a8 Migrate command-line argument processing logic to Config 2011-08-28 22:13:57 +09:00
execjosh f5f436160c Migrate page settings to PhantomConfig 2011-08-27 03:02:59 +09:00
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