Commit Graph

650 Commits (3d874d9e0d089780b40c7b5abc35d0b546249b34)

Author SHA1 Message Date
Ariya Hidayat 293865ceeb Merge remote-tracking branch 'jonleighton/breakpad' 2012-06-08 11:15:32 +02:00
Milian Wolff 5c2e330a15 Make QWebPage::zoomFactor accessible to PhantomJS scripts.
This adds a new WebPage::zoomFactor property, which can be used to
zoom the page, i.e.:

page.zoomFactor = 1.5; // zoom by 50% in
page.zoomFactor = 0.5; // zoom by 50% out

The rasterize.js example is adapted to take an optional fourth argument
to set the zoom factor. Furthermore, the webpage-spec is extended with
a simple test case for the new property.

ISSUE: 579 (http://code.google.com/p/phantomjs/issues/detail?id=579)
2012-06-08 11:05:54 +02:00
Jon Leighton 8f7ee0ecd8 Integrate Google Breakpad crash reporter. Linux only for now. 2012-06-05 23:08:16 +01:00
Jon Leighton 0fa15e51c9 Import Google Breakpad 2012-06-05 23:01:07 +01:00
Jon Leighton & Tom Stuart be4686ab04 Fix remote inspector + static build.
https://code.google.com/p/phantomjs/issues/detail?id=430
2012-06-03 11:17:12 +02:00
Ariya Hidayat c8e311d79d Fix some wrong whitespace.
http://code.google.com/p/phantomjs/issues/detail?id=300
2012-06-02 06:42:14 -07:00
leeight 412c3f4246 FIX build issue with glib 2.31.0+.
Remove the `union GMutex` declaration.

https://bugs.webkit.org/show_bug.cgi?id=72085
http://code.google.com/p/phantomjs/issues/detail?id=559
2012-06-01 22:29:24 -07:00
Ariya Hidayat 1989184fa1 Merge pull request #248 from neraliu/localstorage
Add --local-storage-quota and --local-storage-path options for issue 300...
2012-06-01 21:31:19 -07:00
Ariya Hidayat 824ad9d9d8 Merge pull request #253 from jonleighton/stacktraces
Improve error handling
2012-06-01 21:28:43 -07:00
Jon Leighton ad91d651a8 Pass an actual exception object to the error handler.
Note that for errors that occur within subpages, this object is not the
real error object, but a copy. This is because the real object exists
within the subpage, but the page.onError handler runs within the main
context, so we have to pass it through as data.

https://code.google.com/p/phantomjs/issues/detail?id=166
2012-05-30 20:20:30 +01:00
Nera Liu c85a26a229 Add --local-storage-quota and --local-storage-path options for issue 300.
Add sanity check for the configuration of --local-storage-quota and --local-storage-path.

issue 300 - http://code.google.com/p/phantomjs/issues/detail?id=300
2012-05-19 21:04:01 +08:00
Ariya Hidayat 71425850f6 Mac: Embed Info.plist in the executable.
Info.plist is needed to surpress the dock icon. Up to now, we need to have
the file available at run-time. With this change, the contents of
Info.plist are embedded in the executable at the linking stage, thus
there is no need to deploy the Info.plist file anymore.

Credit to Smokey Ardisson for the tip.

http://code.google.com/p/phantomjs/issues/detail?id=528
2012-05-08 06:44:14 +07:00
Jon Leighton 54c41ae77a Support retrieving the stack of an error
https://code.google.com/p/phantomjs/issues/detail?id=166
2012-05-07 23:29:36 +01:00
Jon Leighton 479b827b66 Enable rich source info for errors.
https://code.google.com/p/phantomjs/issues/detail?id=510
2012-05-07 17:34:07 +01:00
Milian Wolff 4669c16e64 Fix application font loading in basic font db
ISSUE: 460 (http://code.google.com/p/phantomjs/issues/detail?id=460)

this is a backport from qtbase:

commit 89cfe9eb01ad75c14121dbd6038b7c791226acf1
Author: Jiang Jiang <jiang.jiang@nokia.com>
Date:   Thu Nov 10 18:01:56 2011 +0100

    We need to reregister fonts in initializeDb because basic font db
    doesn't have an internal record like fontconfig does, so just
    repopulating the font database won't work. db->reregisterAppFonts
    is now used properly as intended (reregister application fonts
    after the system font database has been cleared).

    Also, static variable 'initialized' in initializeDb() is removed
    since we check privateDb()->count to see if it needs to be populated
    again.

    Task-number: QTBUG-22063

    Change-Id: Ifc66392b56b72acbe08b99256c61421c204be5d7
    Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-05-03 18:16:14 +02:00
Milian Wolff 24a9665c4d Make it possible to print pages with user-defined headers/footers.
Usage:

page.paperSize = {
  margin: "1cm",
  header: {
    height: "1cm",
    contents: phantom.callback(function(pageNum, numPages) {
      return "<h1>" + pageNum + " / " + numPages + "</h1>";
    })
  },
  footer: {
    height: "0.5cm",
    contents: phantom.callback(function(pageNum, numPages) {
      return "<h2>" + pageNum + " / " + numPages + "</h1>";
    })
  }
};

Note: The contents can return arbitrary HTML but since we cannot
re-layout the whole website for every page, the header/footers
must have the static height defined in the height property.

Note: The new example printheaderfooter.js shows the usage. It
also shows how one could delegate the above to a JavaScript
function on the loaded website, which allows one to print pages
and let the actually printed page decide how the header/footer
should look like.

Note: The page-counter can be reset by adding the class "phantomjs_reset_pagination"
to HTML block-elements that should reset the counter.

ISSUE: 410 (http://code.google.com/p/phantomjs/issues/detail?id=410)
2012-04-14 22:04:34 -07:00
Milian Wolff 67d2e8c2f7 Fix crash on close due to an uninitialized pointer in QEventDispatcherQPAPrivate.
ISSUE: 497 (http://code.google.com/p/phantomjs/issues/detail?id=497)
2012-04-11 19:18:20 -07:00
Ariya Hidayat d6f18f7f8b Update CoffeeScript compiler to version 1.3.1.
http://code.google.com/p/phantomjs/issues/detail?id=496
2012-04-11 00:46:43 -07:00
Ariya Hidayat 81794f9096 Squashed commit of the following:
commit c373ac4d17814588f4e3344f634ec469e56c0303
Author: Danny Wang <wangyang0123@gmail.com>
Date:   Tue Apr 10 12:38:13 2012 +0800

    moved i and l delarations to the top of page.evaluate()

commit bf24d4d1ecdb9e06c7bf461e87c222b10b74bc9d
Author: Danny Wang <wangyang0123@gmail.com>
Date:   Tue Apr 10 08:54:55 2012 +0800

    fixed defects in evaluate() pointed out by detro

commit 0bb8cff7803b70fe60fd761b1b748b5510705ee0
Author: Danny Wang <wangyang0123@gmail.com>
Date:   Fri Apr 6 19:21:47 2012 +0800

    added passing variables to function for page.evaluate

    http://code.google.com/p/phantomjs/issues/detail?id=132
2012-04-10 23:52:56 -07:00
Ariya Hidayat 14b1ec6688 Remove setting and command-line option for plugins loading.
http://code.google.com/p/phantomjs/issues/detail?id=418
2012-03-23 07:42:17 -07:00
Ivan De Marino ac771a22b9 Option to pass "headers" when using "open()" on "webpage" module.
Solves [Issue 452](http://code.google.com/p/phantomjs/issues/detail?id=452)
2012-03-23 11:48:16 +00:00
Ivan De Marino 40b1590cbb Adding Webserver "response.closeGracefully()" to easily (and more elegantly) send empty HTTP responses.
Addresses [Issue 451](http://code.google.com/p/phantomjs/issues/detail?id=451)
2012-03-23 11:42:16 +00:00
Ariya Hidayat 3a6c243ca9 Fix visibility warnings during the linking stage.
http://code.google.com/p/phantomjs/issues/detail?id=449
2012-03-22 23:05:46 -07:00
Ariya Hidayat fcc0ff7bae Open master branch for 1.6 development. 2012-03-22 21:24:27 -07:00
Ivan De Marino 985d9c58f2 Second attempt to solve Issue 439.
[Issue 439](http://code.google.com/p/phantomjs/issues/detail?id=439).
This works for all kind of "Content Body" but with raw bytes: the issue is that QtWebKit doesn't know how to convert a "QByteArray" to a "QVariant" (to inject it in the JavaScript space), resulting in a malformed conversion (somehow it decides to create a map where byte position is the 'key' and the byte at that position is the 'value').

This fix covers most scenarios (hopefully) but we are blocked on solving it completely.
2012-03-22 21:14:42 -07:00
Ivan De Marino 775c2ad2af Correct use of "QT_NO_DEBUG_OUTPUT" and "QT_NO_WARNING_OUTPUT" 2012-03-22 21:14:34 -07:00
Ivan De Marino b6d13a3ac7 Fix for Issue [439](http://code.google.com/p/phantomjs/issues/detail?id=439).
Even without "Content-Type" set to "application/x-www-form-urlencoded", content in the body of a POST or PUT should be available.
2012-03-20 17:41:24 -07:00
Ivan De Marino 39ab313200 Fixing the "request.url" field, excluding symbols '/', '&' and '#' from "percent encoding".
Well, it's not really necessary for '#' but I'm just being safe (non-browser clients).

http://code.google.com/p/phantomjs/issues/detail?id=437
2012-03-20 08:57:11 -07:00
Ariya Hidayat 173157555e Get ready for 1.5.0. 2012-03-19 23:47:04 -07:00
Jon Leighton 8f93ca08ea Fix warnings.
Stop passing around lineNumber and sourceID as they are unused and don't
contain useful information.

Also declare Q_UNUSED on them to fix compiler warnings.
2012-03-18 21:44:30 -07:00
Jon Leighton 35e8c94925 Fix try ... catch exception handling.
The hasHandler flag passed to JSC::Debugger::exception only applies to
the current stack frame. It does not indicate if there are exception
handlers in earlier stack frames.

Therefore, we are saving the frame when an exception occurs, but only
reporting the exception if it is still present once the stack has been
fully unwound.

http://code.google.com/p/phantomjs/issues/detail?id=166
2012-03-18 21:44:23 -07:00
Jon Leighton a48770cba3 support for backtraces (part 2).
add a default error handler on all pages. people can override if they
need.
ensure error handler can be removed without errors.

Hack ScriptSourceCode so we can pass in a raw string and not have it
validated as a URL

change source location hint for webpage.evaluate().

http://code.google.com/p/phantomjs/issues/detail?id=166
 Please enter the commit message for your changes. Lines starting
2012-03-17 18:40:41 -07:00
Jon Leighton afe570484f support for backtraces (part 1).
Mostly plumbing in WebKit and Qt bridge.

http://code.google.com/p/phantomjs/issues/detail?id=166
2012-03-17 18:40:41 -07:00
Ariya Hidayat c6091b48c1 Implement fs.readLink to read symlink target.
http://code.google.com/p/phantomjs/issues/detail?id=329
2012-03-16 20:44:56 -07:00
Ariya Hidayat c2c80c0e96 Fix broken GIF support in QPA (Lighthouse).
This is the same issue like the previous broken JPEG.  In non-static
build, GIF is built as plugin. We force to have GIF support built-in by
explicitly change a variable in the configure script (unfortunately this
can't be done via command-line options).

http://code.google.com/p/phantomjs/issues/detail?id=163
http://code.google.com/p/phantomjs/issues/detail?id=432
2012-03-16 07:24:11 -07:00
Ariya Hidayat d9404c0ab8 Be on the safe side and check for Qt == 4.8.0.
http://code.google.com/p/phantomjs/issues/detail?id=272
2012-03-15 22:54:13 -07:00
Ariya Hidayat 8c7b586f03 Remove support for Flash and other plugins.
http://code.google.com/p/phantomjs/issues/detail?id=418
2012-03-15 20:54:35 -07:00
Ariya Hidayat a59f11b7cc Fix broken JPEG support in QPA (Lighthouse).
In non-static build, JPEG is built as plugin. We force to have JPEG
support built-in by explicitly change a variable in the configure
script (unfortunately this can't be done via command-line options).

http://code.google.com/p/phantomjs/issues/detail?id=163
2012-03-15 19:31:04 -07:00
Ariya Hidayat 8673597bc4 Fix mistake in 'require' logic.
(as spotted by Nicolas Perriault).

http://code.google.com/p/phantomjs/issues/detail?id=270
2012-03-15 08:12:12 -07:00
Ariya Hidayat 756d0d3166 Implement system.env to get system environment variables.
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=271
2012-03-15 01:22:17 -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
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
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 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 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 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
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 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
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
Ariya Hidayat ee4cc1125f Qt: allow static build of WebKit.
This is applying allow-static-qtwebkit.patch already used for the
deploy script.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-02 07:25:10 -08:00
Ariya Hidayat 61c4e4b261 Add Qt 4.8.0 source tree.
This is done via the tools/import-qt.sh script. Note that the script
also removes some unnecesary stuff. In practice, src/qt is not as
big as the plain vanilla Qt source tree.

http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-02 07:23:58 -08:00
Milian Wolff 61eb86782b Filesystem module should allow reading and writing binary files.
CommonJS proposal: http://wiki.commonjs.org/wiki/Filesystem/A.
It's called "raw".

http://code.google.com/p/phantomjs/issues/detail?id=400

Squashed commit of the following:

commit dd5fab4778bb7b67f1eca26a07d430aadd458c6e
Author: Milian Wolff <milian.wolff@kdab.com>
Date:   Thu Feb 23 16:19:21 2012 +0100

    the "mode" string is now properly parsed, and not only the first
    char evaluated. This allows us to do fancy things like

    fs.open(file, "rw+"); // read/write/append

    Furthermore .read() is adapted such that it will always return the
    full file contents, no matter where we have seeked to before (i.e.
    by passing + we seek to the end, hence read() would always return
    an empty string).

    To open a binary file, pass "b" in the mode string to fs.open, e.g.:

    fs.open(file, "rb"); // read binary
    fs.open(file, "wb"); // write binary
    fs.open(file, "rwb+"); // read/write binary, append

    alternatively, one can use these shortcuts:

    fs.write(file, contents, "b"); // write binary
    fs.read(file, "b"); // read binary

    Unit tests are extended and the echoToFile.js example fixed (it did not
    close the file, which lead to the contents never getting written
    on-disk since flush() is never called).

    Also note that the FileSystem::open method was cleaned up and at least
    one memory leak (if QFile* could not open) was fixed. The code should
    now also be more C++-like.

commit 41139951138491459accefab22d48eba7b0b9900
Author: Milian Wolff <milian.wolff@kdab.com>
Date:   Wed Feb 15 16:39:23 2012 +0100

    use QString instead of QByteArray for raw binary data

    QByteArray is simply unusable in JavaScript, since functions like
    e.g. window.btoa expect a string. Also there is no sane way to
    create a byte array in javascript, as ArrayBuffer e.g. is not
    supported by QScript (at least there is no conversion in place).

    If we use QString and some custom read/write code this all works
    as expected though, we can use window.btoa to base64 encode binary
    data and we can create random binary data using String.fromCharCode

    also adds a unit test

commit e45673486ef27daf916902153217f9e5001b68c9
Author: Milian Wolff <milian.wolff@kdab.com>
Date:   Wed Feb 15 14:39:15 2012 +0100

    make it possible to read/write raw/binary files

    this adds File::readRaw and File::writeRaw functions,
    as well as 'shimmed' versions FS::readRaw and FS::writeRaw

    these functions directly use QFile and QByteArray instead of
    QTextStream and QString, making it possible to read and write
    binary data, e.g. images and such.
2012-02-29 07:55:00 -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
Ariya Hidayat 4515332d9d Merge remote-tracking branch 'KDAB/printing-margin' 2012-02-23 07:56:45 -08:00
Milian Wolff a638a07339 js-ify, rename and extend print-margins property
Now the left/top/right/bottom print margins can be set separately
using the pageSize.margin property. You can either use

pageSize.margin = "10px"

or use a map to set the margins separately:

pageSize.margin = {
  left: "10px",
  top: "5cm",
  right: "7in",
  bottom: "13mm"
};

pageSize.border is now a synonym for pageSize.margin to keep
compatibility to existing scripts.

ISSUE: 388 (http://code.google.com/p/phantomjs/issues/detail?id=388)
2012-02-23 14:25:16 +01:00
david cd0567e8cd Add support for HTTP request headers modification.
http://code.google.com/p/phantomjs/issues/detail?id=77
2012-02-19 00:49:28 -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
Milian Wolff 1411ebdff6 make POST/PUT data accessible from phantomjs server scripts
For POST and PUT request we now read all data as defined by
the Content-Length header into request.rawData property.
This property is a QByteArray which neatly maps to an array
in javascript.

For POST requests with Content-Type = applicaiton/x-www-form-urlencoded
we furthermore provide a parsed, easy-to-use request.post property.
This one is a QVariantMap of the decoded form data.

There is a new postserver.js example that shows the usage.

The unit test is extended to test the new (and old) features
of the server.

TODO: test that verifies proper decoding of UTF8 data, which
is not yet possible since I see no way to do a post-request
using phantomjs with an explicitly defined charset

ISSUE: 340 (http://code.google.com/p/phantomjs/issues/detail?id=340)
2012-02-15 18:41:51 -08:00
Milian Wolff b224feb246 make it possible to set printing margins separately 2012-02-15 15:55:09 +01:00
Leo Franchi bbce8920d0 Make Mongoose webserver asynchronous.
This allows for asynchronous reply handling, which is much more logical when dealing with the async
nature of PhantomJS like page.open(). This uses a async patch from Andy Rahn's Mongoose close,
available here: http://code.google.com/r/andyrahn-async/

This is from https://github.com/ariya/phantomjs/pull/202.

http://code.google.com/p/phantomjs/issues/detail?id=326
2012-02-14 23:08:38 -08:00
Ariya Hidayat d40fb8e637 Merge pull request #199 from execjosh/fix-issue-367
Charset option for `fs.{open,read,write}`
2012-02-04 23:40:31 -08:00
execjosh 32b3e06ab4 Limit local file URL fix to Qt 4.8.0
http://code.google.com/p/phantomjs/issues/detail?id=365#c17
http://code.google.com/p/phantomjs/issues/detail?id=365#c18
2012-02-05 10:46:31 +09:00
execjosh 9123e4b01f Assume local file if URL scheme is empty
http://code.google.com/p/phantomjs/issues/detail?id=365
2012-02-05 00:31:35 +09:00
execjosh c22dfdc576 Implement charset param for fs.{open,read,write}
http://code.google.com/p/phantomjs/issues/detail?id=367
2012-02-03 00:44:14 +09:00
execjosh 21906c5536 Allow passing option object to fs.{open,read,write}
http://code.google.com/p/phantomjs/issues/detail?id=367
2012-02-03 00:34:45 +09: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
Ariya Hidayat ada732f4f4 Make sure POST works.
With Qt 4.8, POST request with an empty content type will make the
content type set to "application/octet-stream". Somehow this breaks
POST.

The fix is to set the content type to "application/x-www-form-urlencoded",
like the case with Qt 4.7.

Based on the suggestion by Leo Franchi.

http://code.google.com/p/phantomjs/issues/detail?id=337
2012-01-10 08:26:38 -08:00
Ivan De Marino 1531595d2e Heavily simplified (and I dare to say: speed up) the way the remote debugger harness is loaded and injected. 2012-01-04 17:24:36 +00:00
Ivan De Marino e5cd882e6a Fixed type mismatch for this Constructor Parameter. 2012-01-04 17:06:55 +00:00
Ivan De Marino e7ab5e31da Removing a 1 liner method (aka, almost useless) that indeed is not declared (hence, unusable).
Ehm? What?
2012-01-04 17:06:10 +00:00
Ivan De Marino e4f1eb7f99 Removing a forward declaration "left over". 2012-01-04 16:59:49 +00: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
Ivan De Marino 7f42c28024 Fixing a typo (I wonder how did this even worked when tested...). 2012-01-04 16:54:38 +00:00
Alessandro Portale 66a79203b1 Fix linking on Windows
mongoose needs symbols from Ws2_32.lib

http://code.google.com/p/phantomjs/issues/detail?id=331
2012-01-03 07:42:51 -08:00
Will 91b272760b Allow proxy type to be set on the command line.
http://code.google.com/p/phantomjs/issues/detail?id=266
2011-12-26 13:16:31 -08:00
Ariya Hidayat 48027a3f01 Don't display debugging and warning messages.
http://code.google.com/p/phantomjs/issues/detail?id=323
2011-12-25 03:34:42 -08:00
Ariya Hidayat 195bb7238c Only support Qt >= 4.7.
http://code.google.com/p/phantomjs/issues/detail?id=272
2011-12-23 21:18:14 -08:00
Ariya Hidayat 7592806fb8 Current master is for PhantomJS 1.5. 2011-12-23 21:08:42 -08:00
Ariya Hidayat b465acf5d3 Don't create window.WebServer.
It was done for WebPage for backward compatibility and it would be
removed in the future, so don't do it for WebServer.

http://code.google.com/p/phantomjs/issues/detail?id=115
2011-12-22 21:55:00 -08:00
Ariya Hidayat 1e8b0a7336 WebServer: make sure status code is used for writeHead() function.
http://code.google.com/p/phantomjs/issues/detail?id=115
2011-12-21 07:59:39 -08:00
Ariya Hidayat f7675b1627 Clean-up of header includes in webserver.cpp. 2011-12-20 08:24:08 -08:00
Ariya Hidayat 7c07bd43d2 Include --proxy-type option in the usage.
http://code.google.com/p/phantomjs/issues/detail?id=266
2011-12-20 08:11:21 -08:00
Ariya Hidayat 5528c046db Some API changes in the WebServer module.
Trying to match http://nodejs.org/docs/latest/api/http.html.

For the server response:

  * Change writeBody to write
  * Change writeHeaders to writeHead

For the request object, 'headers' is now an object containing all
key-value pairs of the actual HTTP headers.

'queryString' is folded into 'url' key.

Non-standard keys in the request: isSSL, remotePort, remoteIP,
remoteUser, are disabled in the mean-time (will be revisited after 1.4
release).

Implementation-wise, the request object is now a simple key-value pair
using QVariant, as opposed to the heavy QObject instance.

http://code.google.com/p/phantomjs/issues/detail?id=115
2011-12-19 18:38:21 -08:00
Ariya Hidayat f3277bc5e9 Explicitly disable directory listing in the web server.
This is for security, as leaking the directory structure is likely not
the use case of PhantomJS built-in server.

http://code.google.com/p/phantomjs/issues/detail?id=115
2011-12-19 18:01:19 -08: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 471e12a375 JSLint fix: Combine all variable declarations. 2011-12-19 17:52:53 -08:00
Ariya Hidayat d5bc2b8192 Update CoffeeScript compiler to version 1.2.
http://code.google.com/p/phantomjs/issues/detail?id=312
2011-12-19 17:51:45 -08:00
Danny Wang 15ac9ab291 fixed TypeError when call e.url in page.onResourceRequested handler
http://code.google.com/p/phantomjs/issues/detail?id=305
2011-12-13 16:39:09 +08:00
Paul Tsier b10dc130ce Call qRegisterMetaType on mongoose types 2011-12-11 18:54:35 -08:00
Ariya Hidayat 3c0957834c used QUrl::fromEncoded() and QUrl::toEncoded() instead of QUrl(string) and QUrl::toString() when converting urls
Patch by Danny Wang: https://github.com/ariya/phantomjs/pull/183

http://code.google.com/p/phantomjs/issues/detail?id=301
2011-12-11 14:32:00 -08:00
Jon Leighton 38269c7b35 Workaround Qt 4.8 segfault 2011-12-06 20:25:52 +00: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
Jon Leighton 717c4af108 Explicitly link to libdl 2011-11-21 18:12:23 +00:00
Leo Franchi fbdbcd7f69 Minor fixes 2011-11-15 19:11:42 -05: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 bd2052631f basic unit testing for WebServer.listen 2011-11-15 13:45:11 +01:00
Milian Wolff 5eaf705955 basic unit test for webserver 2011-11-15 13:45:11 +01:00
Milian Wolff 667c585424 don't deadlock, could happen on error
i.e. if we tried to listen to an already used port, the error
was propagated in the main thread and the blockingqueuedconnection
would deadlock. not anymore
2011-11-15 13:45:11 +01:00
Milian Wolff 36e8a3e87c cleanup api 2011-11-15 13:45:11 +01:00
Milian Wolff e5a35d6416 some API dox 2011-11-15 13:45:11 +01:00
Milian Wolff 6376ff0cb9 --debug 2011-11-15 13:45:11 +01:00
Milian Wolff a6bde751a9 extend WebServerResponse API 2011-11-15 13:45:11 +01:00
Milian Wolff 705eda8823 add read-properties to WebServerRequest 2011-11-15 13:45:11 +01:00
Milian Wolff 245eec551f make it possible to access the request headers 2011-11-15 13:45:11 +01:00
Milian Wolff f30bfa9fb7 extend WebServerRequest API 2011-11-15 13:45:11 +01:00
Milian Wolff 0abdc7f9ed very basic response + request handling for WebServer
the api is very limited but already makes the server.js example
do something useful with the server
2011-11-15 13:45:11 +01: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
Milian Wolff c3179c3dee move mongoose dir, use same setup like in gif folder 2011-11-15 13:38:01 +01:00
Aditya Ivaturi feed6fdc72 From now on including mongoose directly in the project 2011-11-15 13:38:01 +01:00
Aditya Ivaturi 2e43d7da15 Modified name of the shared lib generated 2011-11-15 13:38:01 +01:00
unknown 2b21135119 Fixed the make command for mingw 2011-11-15 13:38:01 +01:00
Aditya Ivaturi 71ffff002f Adding mongoose code & commented out parts in Makefile to skip the exe generation 2011-11-15 13:38:01 +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
Ariya Hidayat f1b03e84d9 Bump the unstable version to 1.4. 2011-10-29 11:18:50 -05:00
Ariya Hidayat f18fd5372f Fix regression of onInitialized.
As suggested by Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>,
there is no need to use queued connection for initialized() slot.

http://code.google.com/p/phantomjs/issues/detail?id=264
2011-10-25 09:48:27 -05: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 fe20c0987d Avoid deleting a QWebPage inside its own signal emission.
If Phantom.exit() is called inside the handler for loadFinished(), we
end up in a situation that QWebPage is deleting itself during a signal
emission. This used to be OK in QtWebKit 2.0 (Qt 4.7) but is not OK for
QtWebKit 2.2 (upcoming Qt 4.8).

http://code.google.com/p/phantomjs/issues/detail?id=251

Patch by Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>.
2011-10-05 17:26:46 -07:00
Ariya Hidayat eb255817c5 Revert support for getting body of requests or responses.
This is causing a serious regression. For details, check out the
following issues:

http://code.google.com/p/phantomjs/issues/detail?id=158
http://code.google.com/p/phantomjs/issues/detail?id=238
2011-09-20 23:05:34 -07:00
Ariya Hidayat 2d0e4fc57c Fix copy paste mistake for HTTP authentication.
http://code.google.com/p/phantomjs/issues/detail?id=45
2011-09-16 17:36:27 -07:00
Ariya Hidayat 76de868075 Make HTTP authentication as page settings.
http://code.google.com/p/phantomjs/issues/detail?id=45
2011-09-16 17:34:02 -07:00
Ariya Hidayat 4544b129c9 Improve the API for mouse events.
It now looks like in this example:

  page.sendEvent('mousedown', 42, 217);

Other available events are 'mouseup', 'mousemove', and 'click'. They modelled
after the DOM events.

Unit tests are included.

http://code.google.com/p/phantomjs/issues/detail?id=234
2011-09-16 07:15:21 -07:00
Ariya Hidayat df93935d52 about:blank also needs document.head.
This makes it similar to what a typical web browser does.

http://code.google.com/p/phantomjs/issues/detail?id=235
2011-09-16 07:14:38 -07:00
Ariya Hidayat 5449251a6c Unify the name to 'cookiesFile' everywhere.
http://code.google.com/p/phantomjs/issues/detail?id=91
http://code.google.com/p/phantomjs/issues/detail?id=180
2011-09-15 09:40:22 -07:00
Ariya Hidayat 6d42bc0123 Clean-up usage.txt. 2011-09-15 01:08:48 -07:00
Ariya Hidayat eb95355a28 Add --cookies option to the usage.txt. 2011-09-15 01:06:12 -07:00
Ariya Hidayat f73108a1d8 Special handling for about:blank.
http://code.google.com/p/phantomjs/issues/detail?id=235
2011-09-15 00:16:41 -07: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 37404ba179 Fix potential crash in the reply proxy.
The cause is not clear, either the object ownership issue (circular
reference) or some race condition (or worse, both combination).
In all cases, using QPointer avoids dereferencing a null object.

http://code.google.com/p/phantomjs/issues/detail?id=158
2011-09-14 22:47:26 -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 ac9be2a0d4 Sort the include files alphabetically. 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 1ed381c95f Update JSLint flags. 2011-09-11 01:08:49 -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 d844d5404f Fix wrong viewport size due to commit 6e39625e.
http://code.google.com/p/phantomjs/issues/detail?id=217
2011-09-08 23:40:05 -07:00
Ariya Hidayat f7162f7302 Fix coding style (brace placement and indentation with spaces). 2011-09-08 22:35:07 -07:00
Ariya Hidayat e674283821 Fix the proxy option example (http is not needed).
This was mentioned in
http://code.google.com/p/phantomjs/issues/detail?id=19
2011-09-08 21:37:40 -07:00
Ariya Hidayat a62299214d Fix braces placement to follow the coding style. 2011-09-08 17:49:05 -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 b412aba06d bootstrap.js: Reindent properly. 2011-09-08 13:25:44 -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 080eb26a11 Add the proper *.js files to OTHER_FILES. 2011-09-08 07:15:13 -07:00
Ariya Hidayat d94b0c4fbb Fix missing rename from commit 059e7258. 2011-09-07 20:50:02 -07:00
Ariya Hidayat 059e72588c Rename option/config to localToRemoteUrlAccess(Enabled). 2011-09-07 09:27:20 -07:00
Ariya Hidayat d35f81bbda Decouple static helper methods from a class. 2011-09-06 17:00:59 -07:00
Ariya Hidayat bc348c5a35 Give function parameter a proper name. 2011-09-06 17:00:59 -07:00
Ariya Hidayat 962f99fa77 Fix typo in the method name. 2011-09-06 17:00:55 -07:00
Ariya Hidayat e14c07f288 Fix member variable initialization order. 2011-09-06 16:38:51 -07:00
Ariya Hidayat 07c6eb81f5 Sort include files alphabetically. 2011-09-06 16:37:54 -07:00
Ariya Hidayat 3dc9fe53a0 Disk cache object is private for network access. 2011-09-06 16:36:23 -07:00
Ariya Hidayat c0e179d59e Do not manage object lifetime, rely on Qt for that. 2011-09-06 16:35:19 -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 7aa5ec5347 Do not use empty string literal for the default parameter. 2011-09-06 16:01:19 -07:00
Alex Whitman 774070809f Fixes a couple of compiler warnings
* Unused parameter in networkaccessmanager.cpp
* No newline at the end of networkreplyproxy.cpp
2011-09-05 15:23:52 +01: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 88991207c2 Added "copyTree(source, destination)" to the set of File API.
* This is the last API
* I added tests accordingly
* Test could be improved with a proper recursive comparison
* Or, if we introduce "phantom.exec", we could just run a "diff -rq" :)
2011-09-04 23:42:54 +01: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
Ariya Hidayat 5889ef75e9 Merge pull request #149 from Roejames12/master
Tons of updates :)
2011-09-04 00:24:29 -07:00
IceArmy 5f69a34a4f Add execjosh to webpage-shim copyrights 2011-09-03 23:52:36 -07:00
Paul Dixon 461d533348 Removing unnecessary Terminal include 2011-09-02 17:47:33 +02: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 f83b9a5ba7 Added "touch(path)" to the FS API
* Implemented in the JS Shim
* Added test accordingly
2011-09-01 18:06:30 -07:00
Ivan De Marino 750e1e98c4 Added "fs.move(source, dest)" to the set of FS API.
* Added tests accordingly
* The implementation is a pure JS shim
2011-09-01 18:06:30 -07:00
Ivan De Marino 31c2decbd3 Added "copy(source, dest)" to the set of FS API.
* Also, added test case accordingly.
2011-09-01 18:06:30 -07:00
Ivan De Marino 12171fc9c6 Improving compliancy of "remove*" Filesystem API. 2011-09-01 18:06:30 -07: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 96641ea8a1 Added "touch(path)" to the FS API
* Implemented in the JS Shim
* Added test accordingly
2011-09-01 00:34:55 +01:00
Ivan De Marino 619d4b470f Added "fs.move(source, dest)" to the set of FS API.
* Added tests accordingly
* The implementation is a pure JS shim
2011-09-01 00:14:17 +01:00
Ivan De Marino f381f61c64 Added "copy(source, dest)" to the set of FS API.
* Also, added test case accordingly.
2011-09-01 00:01:40 +01:00
Ivan De Marino cffd688efd Improving compliancy of "remove*" Filesystem API. 2011-08-31 23:32:56 +01: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 4dca2b3d60 Fixed issue 212: build problem due to config.h.
Change <config.h> in the GIF code to "config.h" so that it is not
confused with PhantomJS' own config file.
2011-08-31 09:40:43 -07:00
Ariya Hidayat 868e751bea Merge pull request #143 from execjosh/issue-206-web-page-init
Allow for passing options to WebPage constructor
2011-08-31 09:28:58 -07: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 d792cd8d05 Remove ini file related stuff from Config 2011-08-30 00:50:59 +09:00
execjosh 3c4699b609 Add "--config" command-line option 2011-08-30 00:45:39 +09:00
execjosh 26f7185bf6 Implement JSON config loader 2011-08-30 00:43:41 +09:00
execjosh 94c5e270cf Remove superfluous inclusion of QApplication 2011-08-29 23:24:45 +09:00
execjosh 8f89ddc9a3 Make Config extend QObject 2011-08-29 23:23:01 +09:00
execjosh da97b9abbf Fixup copyInto function
* Drop any undefined values
* Copy non-objects, too
2011-08-28 23:12:52 +09:00
execjosh 74db4807d5 Actually add parameter to WebPage constructor 2011-08-28 22:29:31 +09:00
execjosh 3c790d80a8 Migrate command-line argument processing logic to Config 2011-08-28 22:13:57 +09:00
execjosh 9c94a8ef24 Rename ini file code to "Config::loadIniFile" 2011-08-28 21:12:40 +09:00
execjosh ad53b9bb3e Rename "PhantomConfig" to "Config" 2011-08-28 21:11:20 +09:00
execjosh 102b421617 Allow for passing options to WebPage constructor 2011-08-28 19:11:24 +09:00
execjosh 1461ac012d Implement config file (.phantomjsrc) 2011-08-27 03:03:06 +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 66460a7793 Fix building with Qt 4.6. 2011-08-24 05:48:07 -07:00
Ariya Hidayat 6fe972d0a8 Implement WebPage's release() function in pure C++. 2011-08-23 18:53:53 -07:00
Ariya Hidayat 08e6c5b8cd Merge pull request #132 from execjosh/issue-194-default-encoding-utf8
[BUGFIX] issue 194: make default encoding UTF-8
2011-08-22 09:02:29 -07:00
Ariya Hidayat d3cb9fe750 Fix typo. 2011-08-21 22:07:33 -07:00
Ariya Hidayat c75e595ea4 Merge branch 'master' of github.com:ariya/phantomjs 2011-08-21 15:23:07 -07:00
IceArmy fb93d49a7f Rename page.destroy() to page.release() 2011-08-21 14:12:15 -07:00
IceArmy 3caac5a5a3 Rename "XSSAuditing" to "XSSAuditingEnabled" 2011-08-21 14:08:14 -07:00
execjosh d78b1e1f5e [BUGFIX] issue 194: make default encoding UTF-8 2011-08-21 19:48:02 +09:00
Ariya Hidayat f95a39230b Clean up WebPage#open, use named arguments. 2011-08-21 01:34:14 -07:00
Ariya Hidayat 6e4c1a40f2 Simplify WebPage#open, first argument is always url. 2011-08-21 01:25:43 -07:00
Ariya Hidayat 34a7389a2c Make Terminal class a real singleton. 2011-08-21 00:47:34 -07:00
Ariya Hidayat 83922ada2f Ensure consistent #ifdef guard. 2011-08-21 00:30:15 -07:00
Ariya Hidayat 4a96278d1b Include usage.txt in the project file. 2011-08-21 00:21:15 -07:00
Ariya Hidayat d3f10a8e18 Make CSConverter a real singleton. 2011-08-21 00:16:38 -07:00
Ariya Hidayat 944056ce4a Remove unused m_convert from Phantom class. 2011-08-20 23:52:23 -07:00
Ariya Hidayat 52746493c4 Remove useless extra empty line. 2011-08-20 23:45:21 -07:00
Ariya Hidayat 2dbdc36598 Reduce JSLint warnings on the bootstrap code. 2011-08-20 23:21:39 -07:00
Ariya Hidayat 776da4987f Add JSLint directives for the bootstrap code. 2011-08-20 23:11:14 -07:00
Ariya Hidayat 699f4f76f2 Fix coding style (no tab, 4 spaces). 2011-08-20 22:34:11 -07:00
Ariya Hidayat 9d19e02355 Remove stray character in the issue link. 2011-08-20 22:07:18 -07:00
Ariya Hidayat e679640700 Merge branch 'master' of github.com:ariya/phantomjs 2011-08-20 18:13:38 -07:00
Ariya Hidayat 319fd80ec3 Add callback for page initialization.
http://code.google.com/p/phantomjs/issues/detail?id=143
2011-08-20 17:57:01 -07:00
Ariya Hidayat e79a51bdd8 Merge pull request #129 from Roejames12/QWebSettings
New page settings
2011-08-20 17:17:36 -07:00
IceArmy 8880edcf78 Remove settings: jsOpenWindows, jsAccessClipboard, siteSpecificQuirksMode
Renamed jsEnabled to javascriptEnabled
2011-08-20 16:49:36 -07:00
Niek 8deac1b8c6 Fix issue 128 and issue 193 2011-08-20 10:24:56 +02: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