Commit Graph

1157 Commits (71425850f61ad85e33741ed5a59364327532f6a8)

Author SHA1 Message Date
Ariya Hidayat b7d7cfc542 Update more examples to use system.args.
http://code.google.com/p/phantomjs/issues/detail?id=276
2012-03-15 01:11:30 -07:00
execjosh b73ec44796 Update examples to use system.args.
Also update coffee-script script path names in usage messages.

http://code.google.com/p/phantomjs/issues/detail?id=276
2012-03-15 01:11:30 -07:00
Ariya Hidayat 545a3f76b4 Implement system.args to get command-line arguments.
This also means that phantom.args is deprecated.

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

See also http://wiki.commonjs.org/wiki/System#System_Interface.

http://code.google.com/p/phantomjs/issues/detail?id=270
http://code.google.com/p/phantomjs/issues/detail?id=276
2012-03-15 01:11:26 -07:00
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
Jon Leighton 6e929f5fe2 add a bunch of gitignores for Qt build artifacts
http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-14 17:57:28 -07:00
Ariya Hidayat 6c7b0207f4 Make 'Keep Alive' option to use camel case.
Change 'keep-alive' to 'keepAlive' in the option for the server.
This allows setting the value (in JS object literal) without quoting.

http://code.google.com/p/phantomjs/issues/detail?id=429
2012-03-14 10:52:57 -07:00
Milian Wolff 21fd5b6716 cleanup wait-code for response.close using a semaphore concept
ISSUE: 429 (http://code.google.com/p/phantomjs/issues/detail?id=429)
2012-03-14 10:46:34 -07:00
Ariya Hidayat 6c8a1c2dc1 No X11 requirement on Linux.
This is achieved by using QPA (aka Qt Lighthouse).

http://code.google.com/p/phantomjs/issues/detail?id=163
2012-03-13 22:07:10 -07:00
Ariya Hidayat c78ae190a9 Implement a custom platform integration for Unix QPA operation.
These classes are from the official Qt 4.8.0 platform plugins with some
tweaks:

* By default, use Fontconfig font database.
* No need to save the captured screen on every flush.
* Enlarge the screen to make it more like a typical desktop size.

http://code.google.com/p/phantomjs/issues/detail?id=163
2012-03-13 22:04:05 -07:00
Ariya Hidayat 83af966d94 Modify QPA application to use the custom minimal integration.
http://code.google.com/p/phantomjs/issues/detail?id=163
2012-03-13 21:57:52 -07:00
Ariya Hidayat 6de3e7fdb9 Allow non-X11 to use Freetype font engine.
http://code.google.com/p/phantomjs/issues/detail?id=163
2012-03-13 21:31:11 -07:00
Ariya Hidayat 4c3897fece Make it possible to test QPA (Lighthouse) on Mac.
Do not use CoreText if QPA is specified.
Warning: this is only for testing purposes and it has no practical
use right now.

http://code.google.com/p/phantomjs/issues/detail?id=163
2012-03-13 19:36:10 -07:00
Ariya Hidayat f7ec1533d6 Qt build: Really disable PulseAudio support.
In order to avoid configuration-time detection of PulseAudio,
Qt configure script is slightly modified so that no attempt to
carry out the detection would be made.

http://code.google.com/p/phantomjs/issues/detail?id=226
http://code.google.com/p/phantomjs/issues/detail?id=414
2012-03-13 19:35:01 -07:00
Milian Wolff 7b909bfe45 Add example for keep-alive enabled webserver.
See examples/serverkeepalive.js.

http://code.google.com/p/phantomjs/issues/detail?id=416
2012-03-13 19:01:24 -07:00
Ariya Hidayat 4656988209 Qt build: Ignore PulseAudio for the time being.
http://code.google.com/p/phantomjs/issues/detail?id=226
http://code.google.com/p/phantomjs/issues/detail?id=414
2012-03-13 00:32:39 -07:00
Ariya Hidayat 35afa8fc99 Qt build: Disable ICU, system zlib, and PulseAudio.
http://code.google.com/p/phantomjs/issues/detail?id=226
http://code.google.com/p/phantomjs/issues/detail?id=414
2012-03-13 00:09:39 -07:00
Ariya Hidayat 8965adf7d2 Build: Apply FreeBSD patch to build Mongoose.
This is originally from:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/phantomjs/files/patch-src-mongoose-mongoose.c.

http://code.google.com/p/phantomjs/issues/detail?id=341
2012-03-12 23:45:59 -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
Ariya Hidayat 21106b4289 WebKit: Add an API to enable and disable Web Security setting.
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 22:44:13 -07:00
Ariya Hidayat 74d4a6bd90 Change tweets.js example to official HeadlessPhantom Twitter account.
http://code.google.com/p/phantomjs/issues/detail?id=425
2012-03-12 21:35:40 -07:00
Alessandro Portale 5eb9d8a102 No need for stdint.h and unistd.h when building with MSVC
MSVC 2008 and lower did not provide stdint.h and unistd.h.
This patch adjusts gif.pri, accordingly. We typedef uint32_t
ourselves in gif_hash.h.

http://code.google.com/p/phantomjs/issues/detail?id=424
2012-03-12 21:04:55 -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
Ivan De Marino 2451001d81 Create an import script for LineNoise.
This addresses [Issue #409](http://code.google.com/p/phantomjs/issues/detail?id=409).

The script:
* Get the latest code. Since LineNoise is pretty small, grabbing the tarball straight from the repo should be just fine.
* Extract and place the files in the right directory (src/linenoise).
* Remove unnecessary stuff (project files etc).
* Update the src/linenoise/README.md to refer to the revision being imported.
2012-03-12 20:44:04 -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 13d4f28ece Build scripts clean up.
The contents of deploy/build* scripts have been merged and consolidated
into ./build.sh as part of the Qt import workflow.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-09 07:29:48 -08:00
Ariya Hidayat ac699a4d90 WebKit: Support multiple console.log arguments.
http://code.google.com/p/phantomjs/issues/detail?id=36
2012-03-08 22:10:42 -08:00
Milian Wolff ac906391d4 support keep-alive in the webserver
The recent patch that brought asynchronous webserver response handling
made it impossible to have proper keep-alive support in the server.

We want the server to support keep-alive though, which is especially
useful when writing a PhantomJS script that allows one to "remote control"
PhantomJS, using the WebServer API, without flooding the TCP connections.
Also the performance might be improved.

Note: This patch reverts commit bbce8920d0,
and resets the Mongoose code to the vanilla 3.0 version. Instead we now
support the async handling of HTTP requests using some QWaitCondition
magic.

Note: keep-alive support is optional, and disabled by default. To enable
it, use something like:

server.listen(port, {"keep-alive": true}, function(request, response) {...});

Like before, calling response.close() is crucial. Furthermore though, a
server that has keep-alive enabled *must* set a proper "Content-Length: ..."
header in it's response, otherwise clients will not be able to know when
the response has finished.

fix memory leaks in webserver

ISSUE: 416 (http://code.google.com/p/phantomjs/issues/detail?id=416)
2012-03-08 22:10:17 -08:00
Ariya Hidayat a398b3fec0 Revamp the build scripts in deploy/.
Technically only deploy/package-linux-dynamic.sh is relevant and it's
been adjusted appropriately. All other files are obsoleted with the new
build process.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-08 21:58:30 -08:00
Ariya Hidayat 8c01f46e4d Qt build: More configuration flags for Mac OS X.
This is just adopting the settings from deploy/build-mac.sh.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-08 21:56:02 -08:00
Ariya Hidayat de13c551fb Qt Gui: Disable Graphics View.
Graphics View is not needed for PhantomJS.

http://code.google.com/p/phantomjs/issues/detail?id=414
2012-03-08 07:23:54 -08:00
Ariya Hidayat 1faf94de11 WebKit: Turn off accelerated compositing.
Compositing depends on Graphics View and/or GL-based texture mapper.
Since we don't plan to support either of them, at least for the near
future, we might as well disable compositing.

http://code.google.com/p/phantomjs/issues/detail?id=414
2012-03-08 07:23:22 -08:00
Ariya Hidayat cbe64f0f0f Fix file upload on Qt 4.8.
This is just applying enable_file_input_click.patch.

See the previous commit 00a8e72fb3.

http://code.google.com/p/phantomjs/issues/detail?id=307&q=upload
2012-03-06 23:11:24 -08:00
Ariya Hidayat 08fc50d149 Headless and PDF printing fixes.
This is just applying headless_and_pdf_fixes.patch.
See also https://github.com/ariya/phantomjs/pull/173..
2012-03-06 23:11:23 -08:00
Ariya Hidayat 6299e14641 Fix remote inspection to work.
This is applying fix_inspector.patch.
See also https://github.com/ariya/phantomjs/pull/173.

http://code.google.com/p/phantomjs/issues/detail?id=6
2012-03-06 23:11:23 -08:00
Ariya Hidayat b7a69df6ec Enable remote debugging.
This is just applying enable_debugger.patch.
See also https://github.com/ariya/phantomjs/pull/173.

http://code.google.com/p/phantomjs/issues/detail?id=6
2012-03-06 23:11:23 -08:00
Ariya Hidayat 714642c66c Qt workaround to prevent WebCoreMovieObserver confusion.
See the previous commit 30134bab5d.
This is just applying disable-quicktime-video.patch.

http://code.google.com/p/phantomjs/issues/detail?id=321
2012-03-06 23:11:08 -08:00
Ariya Hidayat 4ccfa463b9 Qt import: Script to build everything, for Linux and Mac OS X.
http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-06 19:01:24 -08:00
Ariya Hidayat 33f436d703 Qt import: use static build on Linux only.
http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-06 18:49:04 -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
Ariya Hidayat 36cd85a475 Qt import: Sync with the steps in deploy/build-helper.
http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-06 18:23:10 -08:00
Ariya Hidayat df93134703 Qt import: Use a customized src.pro.
We need to exclude building SQL, TestLib, and plugins.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-06 18:22:54 -08:00
Ariya Hidayat cbdd80e98e Qt import: Do not force the use HarfBuzz on Mac.
Configure option -harfbuzz breaks Linux build.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-06 17:53:44 -08:00
Brian Donovan f34e8b1528 Without arguments, functions must use parentheses in CoffeeScript.
http://code.google.com/p/phantomjs/issues/detail?id=326
2012-03-05 21:34:52 -08:00
Ivan De Marino 49c2900767 Adding short version of "--help" and "--version" command-line arguments.
This covers [Issue #408](http://code.google.com/p/phantomjs/issues/detail?id=408).
2012-03-05 21:20:52 -08:00
Ariya Hidayat 1ae3c5aa2b Change follow.* example to Twitter accounts of PhantomJS contributors.
http://code.google.com/p/phantomjs/issues/detail?id=405
2012-03-04 21:49:47 -08:00
Ariya Hidayat 4b3bb8e049 Add the missing usage info on REPL.
http://code.google.com/p/phantomjs/issues/detail?id=252
2012-03-04 21:39:13 -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
Milian Wolff a0ef8cb898 simplify maintenance of custom qt-patches during deployment
generic patches now reside in deploy/qt-patches/all
while 4.8 patches are now in deploy/qt-patches/4.8

all *.patch files in these folders are applied during deployment

http://code.google.com/p/phantomjs/issues/detail?id=197
http://code.google.com/p/phantomjs/issues/detail?id=142
2012-03-04 21:07:26 -08:00
Milian Wolff 9943ae541b fix headless-build on linux
in such cases, DISABLE_HEADLESS was unset and hence
the expansion -a -eq 0 resulted in a bash error:

bash: [: too many arguments

this is fixed now by using string-based comparison

http://code.google.com/p/phantomjs/issues/detail?id=197
2012-03-04 21:06:24 -08:00
Ariya Hidayat 0d77f588ec Qt Mac: workaround qt_menu.nib problem.
This is applying qapplication_skip_qtmenu.patch.

See also the upstream bug:
https://bugreports.qt.nokia.com/browse/QTBUG-5952

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-02 07:25:31 -08:00