Commit Graph

1255 Commits (c856f13fec45676f4633b2a3bbeb955db1ff6bcd)

Author SHA1 Message Date
Ariya Hidayat da078de819 Add the importer script to include Qt source.
http://code.google.com/p/phantomjs/issues/detail?id=226
2012-03-02 07:22:09 -08:00
Chris Smith ddc0a7d623 Fix jasmine example terminating too early against jasmine 1.1.0.
The .finished-at element that was being checked for is present all
the time during the test run, so the waitFor call ended too early.

http://code.google.com/p/phantomjs/issues/detail?id=402
2012-03-01 08:17:51 -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
Baffo32 9d1c2e90ac Update phantom spec version test 2012-02-15 18:47:56 -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
Jon Leighton 7fa13832ef Deploy script refactoring and improvements.
For some detailed discussion, check out
https://github.com/ariya/phantomjs/pull/190.

http://code.google.com/p/phantomjs/issues/detail?id=197
http://code.google.com/p/phantomjs/issues/detail?id=142
2012-02-09 01:12:47 -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
Ariya Hidayat 86e28b0bf1 Merge pull request #200 from execjosh/fix-issue-365
Assume local file if URL scheme is empty (Issue 365)
2012-02-04 23:07:55 -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
Maurice Svay 28071ebcae Update content, optimize loading
Add favicon
Update content
Add links
Add :hover states
Add credits for icons
Minify CSS

http://code.google.com/p/phantomjs/issues/detail?id=355
2012-02-03 09:10:35 -08:00
Maurice Svay e734c3180f Website: new homepage (not optimized)
http://code.google.com/p/phantomjs/issues/detail?id=355
2012-02-03 08:43:18 -08: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
Ariya Hidayat f6c29b16c1 Remove PyPhantomJS.
Since there is no future maintainer, the code should not be there anymore.

http://code.google.com/p/phantomjs/issues/detail?id=344
2012-01-15 18:24:18 -08:00
Ariya Hidayat 1770a4fd33 Add existing contents of the web site.
First step towards collaboration on the improved new site.

http://code.google.com/p/phantomjs/issues/detail?id=355
2012-01-15 18:16:52 -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
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
Ariya Hidayat 2ed8acb630 Merge pull request #189 from detro/master
Minor fixes found during my catchup process
2012-01-04 16:47:18 -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
Ariya Hidayat 037009fefe Changes for 1.4.1. 2011-12-30 08:28:56 -08:00
Ariya Hidayat 84cd6a61ad Merge branch 'master' of github.com:ariya/phantomjs
Conflicts:
	deploy/build-mac.sh
2011-12-30 07:32:12 -08:00
Ariya Hidayat 4e5319771c Merge pull request #187 from jonleighton/qt_48_fixes
Qt 4.8 fixes
2011-12-30 07:03:14 -08:00
Jon Leighton e6b6f2ec2e Add a test for file upload support 2011-12-30 11:58:23 +00:00
Jon Leighton 39e4485ce3 Ignore source files in the deploy/ directory 2011-12-30 11:47:09 +00:00
Jon Leighton 977e1aab17 Make linux build script use the Qt 4.8.0 tarball.
Also make it always put the files in deploy/, regardless of where the
script is run from. (So use can run deploy/build-linux.sh from the root
directory.)
2011-12-30 11:47:03 +00:00
Jon Leighton 00a8e72fb3 Fix file upload on Qt 4.8.
Code was added to WebKit to detect whether the click event on the file
input element is triggered by user action or by a script. If it's by a
script, the event is ignored. This prevented us from simulating a click
on the element.

This fix just patches WebKit to remove the detection.

The relevant WebKit commit is:

  931870c11b

The associated WebKit bug is:

  https://bugs.webkit.org/show_bug.cgi?id=47593

Our bug is:

  http://code.google.com/p/phantomjs/issues/detail?id=307&q=upload
2011-12-30 11:46:58 +00:00
Ariya Hidayat 30134bab5d Workaround to prevent WebCoreMovieObserver confusion.
The solution is for the static build script to disable QuickTime video.
In many cases, video support for a headless engine is not so useful.

http://code.google.com/p/phantomjs/issues/detail?id=321
2011-12-29 19:25:18 -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 bb07cb941e Linux build script: Keep to 4 parallel jobs at most.
http://code.google.com/p/phantomjs/issues/detail?id=197
2011-12-23 21:06:23 -08:00
Ariya Hidayat a383afefd0 Refer to 1.4 in the README. 2011-12-22 21:56:11 -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