Commit Graph

1157 Commits (71425850f61ad85e33741ed5a59364327532f6a8)

Author SHA1 Message Date
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
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 bf029ae65a Properly handle fourth CLI parameter in rasterize.js example.
After the change to system.args which has the app as first element,
the rasterize example was not properly adapted. Due to that, one
could not pass a size parameter to it anymore, resulting in PDFs
without page breaks.

ISSUE: 523 (http://code.google.com/p/phantomjs/issues/detail?id=523)
2012-05-02 15:31:46 +02:00
Milian Wolff b3d74c9a6c Extend printheaderfooter.js example documentation
The comment now explains how to delegate the header/footer setup
to the loaded HTML page by giving an explicit HTML example that
defines the required PhantomJSPrinting object

ISSUE: 512 (http://code.google.com/p/phantomjs/issues/detail?id=512)
2012-04-30 16:52:28 +07:00
Milian Wolff e185a5c2b6 Improve package-linux-dynamic.sh to create a quasi-static phantomjs.
The script now copies all required shared libraries found via ldd
to the deployment folder.

Furthermore, a run-script is created that runs the phantomjs binary
through the copied build-host's ld-linux.so to ensure all symbols
are properly resolved.

Last but not least, we now include a very slightly modified brandelf.c
from FreeBSD. This version can be compiled on Linux machines and is
used to change the ELF ABI of the binary and libs in the deployment
folder, such that they all use the old SYSV OS ABI for compatibility.

Usage:
$ package-linux-dynamic.sh
$ scp phantomjs-$version.tar.bz2 yourhost
$ ssh yourhost
$ tar -xf phantomjs-$version.tar.bz2
$ ./phantomjs-$version/phantomjs.sh

CC ISSUE: 413 (http://code.google.com/p/phantomjs/issues/detail?id=413)

(proper static build would still be desirable eventually if possible)
2012-04-25 19:36:00 +02:00
Milian Wolff 2c4e7b6a7e Properly pass --qt-config value from build.sh to src/qt/preconfig.sh.
This way one can properly cross-compile PhantomJS for different
platforms e.g. by passing --qt-config '-platform ...' to build.sh.

ISSUE: 507 (http://code.google.com/p/phantomjs/issues/detail?id=507)
2012-04-20 13:38:11 +02:00
Milian Wolff 3a84eb6d16 Reuse number of jobs configured in MAKEFLAGS env var if available
Especially on machines that are connected to a compile farm, the
MAKEFLAGS env var is usually set to configure the default number
of jobs that should be used. This way, one can just call the
PhantomJS build script without passing the number of jobs every
time.

ISSUE: 503 (http://code.google.com/p/phantomjs/issues/detail?id=503)
2012-04-18 14:19:43 +02:00
Ariya Hidayat d937e6e05a Fixed minor typo in README.md.
Thanks to Alessandro for spotting it.
2012-04-16 17:11:05 -07:00
Ariya Hidayat edc93dc8d0 Build system: do not assume 4 parallel jobs on Linux.
Try to grab the number of CPU cores from /proc/cpuinfo and use it as
the number of parallel make jobs (limit to 8 as a safety measure).

http://code.google.com/p/phantomjs/issues/detail?id=454
2012-04-15 18:21:02 -07:00
Ariya Hidayat 5a46423d28 Improve README.md regarding the contributors.
http://code.google.com/p/phantomjs/issues/detail?id=419
2012-04-15 11:27:22 -07: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 f6f139e99f Moved to gh-pages branch.
http://code.google.com/p/phantomjs/issues/detail?id=490
2012-04-11 00:44:40 -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 afb0707c9d Improve PhantomJS README, fix minor editing issue.
http://code.google.com/p/phantomjs/issues/detail?id=419
2012-04-01 17:32:43 -07:00
Ariya Hidayat 29d98196b9 Improve PhantomJS README, mention well-known related projects.
Also minor editing everywhere else.

http://code.google.com/p/phantomjs/issues/detail?id=419
2012-04-01 16:20:45 -07:00
Ariya Hidayat 7ec234801b Improve PhantomJS README with various use cases.
http://code.google.com/p/phantomjs/issues/detail?id=419
2012-04-01 08:44:22 -07:00
Ariya Hidayat 71323e3be1 Improve PhantomJS description.
First cut at a more modernized version of the README.

http://code.google.com/p/phantomjs/issues/detail?id=419
2012-04-01 08:20:39 -07:00
david 8c645ecd79 Added tests for customHeaders.
http://code.google.com/p/phantomjs/issues/detail?id=77.
2012-03-27 22:23:46 -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 03e47a1712 Fixing defect in the "Filesystem Spec 03".
Too strong assumption regarding the Current Working Directory.
2012-03-23 11:45:13 +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
Ivan De Marino 59c4e32c60 Updating "webserver" test spec.
I also made a minor fix in the logic of "system" test spec:
too strong assumption on the CurrentWorkingDirectory
when launching the test.
2012-03-23 10:56:51 +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
Ariya Hidayat 8db267bb56 Bracing for Ghost Flower. 2012-03-20 17:52:43 -07:00
Ariya Hidayat f3cfb74cfc More changes for 1.5. 2012-03-20 17:52:31 -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 eb112f5c3d Update web site to mention version 1.5. 2012-03-20 00:03:51 -07:00
Ariya Hidayat b0de295132 Changes for 1.5.0. 2012-03-19 23:59:41 -07:00
Ariya Hidayat 173157555e Get ready for 1.5.0. 2012-03-19 23:47:04 -07:00
Jon Leighton adcb14dd0e Basic tests for the onError handler
http://code.google.com/p/phantomjs/issues/detail?id=166
2012-03-18 21:44:31 -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 59a777e348 Add a simple check to ensure that there is no loaded plugin.
http://code.google.com/p/phantomjs/issues/detail?id=418
2012-03-15 21:47:01 -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 26b28d7842 printenv.js: New example to show system.env.
This is very similar to Unix common 'printenv'.

http://code.google.com/p/phantomjs/issues/detail?id=271
2012-03-15 01:33:27 -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