Commit Graph

744 Commits (master)

Author SHA1 Message Date
Sven Eckelmann 800fbe8452 Don't scale the unit px to 1/2.54 points for PDFs
The unit px is one point inside the HTML source page but phantomjs handles it
without reason as 1/2.54 points. This makes the page smaller than expected when
trying to render a page as PDF.

https://github.com/ariya/phantomjs/issues/11590 ("page.paperSize is not
accurate for .pdf")
2014-05-31 08:23:13 -07:00
Thomas Schlage 9da842df2b Added setProxy function
https://github.com/ariya/phantomjs/issues/10803
2014-04-17 23:02:15 -07:00
Richard Harris 7d3f3f0819 Fix harfbuzz assertions using patch from Chromium.
Exotic text (e.g. attempting to render a binary file such as .zip
or .exe as a webpage) can trigger an assertion failure in the
Harfbuzz code. Chromium developers also noticed this issue and
committed a patch to fix it:

http://lists.freedesktop.org/archives/harfbuzz/2009-August/000354.html

This patch has not been accepted by upstream, but this (old) version
of Harfbuzz has been abandoned and superceded by Harfbuzz-NG.

Issue #11264
2014-04-07 21:58:36 -07:00
Ivan De Marino ba5998f74e Making GhostDriver test "quiet-er" (and parallel)
Also, trying to get the exit status of those tests reported, in case they fail.

Related to #11952.
2014-03-09 01:02:21 +00:00
Ivan De Marino 1797c146f1 Adding "test/ghostdriver-test" to run in Travis CI
Related to issue #11880
2014-03-08 23:37:47 +00:00
Rikke Simonsen bda8838698 Fix for crash bug caused by Iframe NULL reference
https://github.com/ariya/phantomjs/issues/10947
https://github.com/ariya/phantomjs/issues/11103
https://github.com/ariya/phantomjs/pull/11984
2014-02-19 21:30:11 -08:00
Ivan De Marino 056aa50c19 Importing GhostDriver 1.1.1.
Yes, 1.1.0 has just been imported.
But the key feature in 1.1.1 is Session Isolation in WebDriver: something that has been requested many times,
particularly when using GhostDriver with Selenium Grid.
2014-01-12 21:08:21 +00:00
Joseph Rollinson 244cf251cd Adds support for multiple Cookie Jars.
Previously, there was a single global cookie jar shared between all web pages.
Now, one can have separate cookie jars for different web pages.

Makes CookieJar a normal class, not a singleton.
Moves many public CookieJar methods to public slots.
Adds default cookie jar to Phantom.
Adds the CookieJar module that provides access to cookie jars in javascript.
Adds cookie jar module tests.

Usage:
var jar = require('cookiejar').create();
var webpage = require('webpage').create();
webpage.cookieJar = jar;
...
webpage.close();
jar.close();

JS API changes:
Webpage:
    var jar = page.cookieJar; -- assigns 'jar' the given webpage's cookie jar.
    page.cookiejar = jar; -- sets 'jar' as the given webpage's cookie jar.
CookieJar:
    var jar = require('cookiejar').create(path)
        creates a cookie jar with persistent storage at the given file path
        (path not mandatory).
    var cookies = jar.cookies; -- assign's 'jar' the list of cookies in the
        cookie jar.
    jar.cookies = [c1, c2]; -- sets the cookie jar's cookies as the ones in the
        list.
    jar.addCookie(cookie) -- adds cookie 'cookie' to the cookie jar.

https://github.com/ariya/phantomjs/issues/11417
2014-01-10 16:12:39 -08:00
Ashish Kulkarni 3ed2f68909 Implement "page-break-inside: avoid" for non-floating block elements.
This patch is taken from https://bugs.webkit.org/show_bug.cgi?id=5097#c17

It was originally part of PR #211 but was possibly overlooked in PR #344
(when the other two patches got reapplied after the QT source import).
2014-01-07 08:46:18 -08:00
Ariya Hidayat 6b45113cfe QWidget: Fix unused parameter warning when there's no Graphics View.
This reduces the amount of repetitive compiler warnings.

https://github.com/ariya/phantomjs/issues/11880
2014-01-06 23:27:34 -08:00
Ariya Hidayat 266ef0da59 Travis CI: Silent build.
https://github.com/ariya/phantomjs/issues/11880
2014-01-06 22:35:02 -08:00
James McParlane dca15d7ff6 Added onRepaint callback to webpage API.
Enables subscription to RepaintRequested events.
When the callback is invoked the time that the repaint was requested as well as the x,y and width,height of the repainted rectangle are provided as parameters.
Usage: page.onRepaint = function(time, x, y, width, height) { }

https://github.com/ariya/phantomjs/issues/11793
2014-01-06 23:05:30 +00:00
Ivan De Marino 9bfe22b428 Merge pull request #11784 from vvavrychuk/parse-error
fix lack of parse time errors location info
2014-01-06 11:30:29 -08:00
Ivan De Marino a9a219e74b Importing GhostDriver 1.1.0 in PhantomJS.
CHANGELOG for v1.1.0 (https://github.com/detro/ghostdriver/issues?labels=1.1.0&state=closed)

JavaScript Driver (Core)
* ENHANCEMENT: `/maximize` window will set the window size to 1336x768,
currently most common resolution online (see http://gs.statcounter.com/#resolution-ww-monthly-201307-201312)
* ENHANCEMENT #275: Implemented Browser and Network (HAR) Logging types
* FIXED #284: Attempt to wait for Page to Load if input causes form submit
* FIXED #291: Throw exception when attempting to set invalid timeout value
* FIXED #259: Fix issue regarding mouse clicks
* ENHANCEMENT #290: Enabled support for "Keep Alive" HTTP connections
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Driver part)
* ENHANCEMENT #293: Import Selenium 2.39.0 WebDriver Atoms

Java Binding
* MINOR #251: Minor compilation issues for Binding
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Java Binding part)

Tested using GhostDriver validation tests (https://github.com/detro/ghostdriver/tree/master/test).

https://github.com/ariya/phantomjs/pull/11877
2014-01-04 14:44:04 -08:00
Ariya Hidayat b70ff8929c Fix warning of obsolete userSpaceScaleFactor on OS X 10.9 (Mavericks).
Related upstream bug: https://bugreports.qt-project.org/browse/QTBUG-28574

Issue #1162 https://github.com/ariya/phantomjs/issues/11612
2014-01-03 20:41:00 -08:00
Ariya Hidayat b67866b612 Fix CoreText performance note on OS X 10.9 (Mavericks).
Upstream Qt bug: https://bugreports.qt-project.org/browse/QTBUG-32789
Upstream patch: https://codereview.qt-project.org/#patch,all,70097,4.
Upstream commit: https://qt.gitorious.org/qt/qt/commit/98352b964f

https://github.com/ariya/phantomjs/issues/11418
2014-01-03 20:40:53 -08:00
Brad Daily e40ebb93d7 Pass modifier to mouse events for click/dblclick
A fix for the issue described here:

https://github.com/ariya/phantomjs/issues/11867
2014-01-01 11:06:11 -05:00
Aaron Stone 3d80670e22 Handle script language in debug mode too.
f919121a35
2013-12-15 22:27:26 -08:00
Aaron Stone 176d435901 REPL is only valid for javascript updates.
https://github.com/ariya/phantomjs/issues/11744
2013-12-15 22:27:10 -08:00
Oleg Plakhotniuk f4128d7ede Select monospace font family properly.
CSS style "font-family: monospace" should select monospace font.

https://github.com/ariya/phantomjs/issues/11764
2013-12-13 07:34:49 -08:00
Aaron Stone 4ca640c5e7 Reject script-language values other than javascript and coffeescript
https://github.com/ariya/phantomjs/issues/11744
2013-12-13 06:58:20 -08:00
Aaron Stone 394e2f8699 Add option --script-language to explicitly set javascript or coffeescript
https://github.com/ariya/phantomjs/issues/11744
2013-12-13 06:58:04 -08:00
Francisco de Borja Lopez Río d5eaf41063 Set proper jobs number and library paths before building in OpenBSD
https://github.com/ariya/phantomjs/issues/10996
2013-12-05 07:30:02 -08:00
Vitaliy Slobodin efcc6c7861 Define the new page callback for interrupting a long-running JavaScript
Issues:
https://github.com/ariya/phantomjs/issues/11198
https://github.com/ariya/phantomjs/issues/11183
https://github.com/ariya/phantomjs/issues/11189
2013-11-23 22:09:39 -08:00
Vasyl Vavrychuk c8e4215097 fix lack of parse time errors location info
Location information of parse time error is given to javaScriptError not
with stack by with separate lineNumber and sourceID arguments. Put this info
to stack if it is empty so that it will be visible to user.

https://github.com/ariya/phantomjs/issues/11640
2013-11-24 01:43:10 +02:00
Vitaliy Slobodin 6a01a8dece Upgrade to Qt 4.8.5
https://github.com/ariya/phantomjs/issues/11452
2013-10-19 07:52:31 -07:00
Max Edmands 94e63bfa04 Fix typo in the cookie jar debug message. 2013-10-19 07:52:01 -07:00
Vitaliy Slobodin 23df8811a1 REPL returns empty object on enumerating properties on a simple JavaScript type (Number, String, Logical).
We should not to do that.

Issue:
https://github.com/ariya/phantomjs/issues/11622
2013-10-07 20:33:52 -07:00
Mike McQuaid fe6a967bad Fix Clang compilation
Already merged in Qt: b82b8bfa81

Issue #11611 https://github.com/ariya/phantomjs/pull/11611
2013-10-01 07:38:40 -07:00
hexid b1e181176e Add require.paths support
Issues: https://github.com/n1k0/casperjs/issues/462 https://github.com/ariya/phantomjs/issues/11339
2013-09-01 07:53:08 -07:00
Ivan De Marino 73bb560840 Import GhostDriver v1.0.4
Issues in this release: https://github.com/detro/ghostdriver/issues?labels=1.0.4&state=closed
See GhostDriver Changelog for more details.
2013-07-25 23:24:53 +01:00
Dmitry Parshin 8114d44a28 fixed compile errors for no-JIT configuration
Issue #11475 https://github.com/ariya/phantomjs/issues/11475
2013-07-24 23:38:44 -07:00
Richard Harris 4989445e71 Fix harfbuzz assertions using patch from Chromium.
Exotic text (e.g. attempting to render a binary file such as .zip
or .exe as a webpage) can trigger an assertion failure in the
Harfbuzz code. Chromium developers also noticed this issue and
committed a patch to fix it:

http://lists.freedesktop.org/archives/harfbuzz/2009-August/000354.html

This patch has not been accepted by upstream, but this (old) version
of Harfbuzz has been abandoned and superceded by Harfbuzz-NG.

Issue #11264
2013-07-24 23:34:45 -07:00
Vitaliy Slobodin 1a25383307 Use Qt::transparent to resolve graphical artifacts with images with transparent background.
We need to use QImage::Format_ARGB32_Premultiplied on Windows to preserve a text hinting and antialiasing. Using the function `qRgba()` leads to wrong pixel values on a target image. Since, `QImage::fill(uint pixel)` doesn't handle the QImage::Format_ARGB32_Premultiplied format, so we need to use the another overload `QImage::fill(const QColor &color)`

Issues:
https://github.com/ariya/phantomjs/issues/11276
https://github.com/ariya/phantomjs/issues/11007
https://github.com/ariya/phantomjs/issues/11366
2013-06-24 01:07:24 +04:00
Ivan De Marino c466d8aeef WebServer Headers for Request are treated case-insensitive
To achieve this, Request Headers are stored in both "original" and "lowercase".
In this way we don't mangle with the request object we have received, while
still be able to handle headers when NOT in the classic "Camel-Case" format.

Fixes #11421.
2013-06-21 23:51:05 +01:00
Vitaliy Slobodin 4d916971b3 Fix including http:// in the proxy URL:
The proxy host parsed incorrectly, when it was typed with a scheme (http or https).
Now proxy can be specified with the scheme.

Fix invalid type conversion:
m_proxyPort converts to its ASCII representation.
Use `QString::number` to include a proxy port properly.

Issues:
https://github.com/ariya/phantomjs/issues/11117
https://github.com/ariya/phantomjs/issues/10811
2013-05-29 00:38:15 +04:00
Vitaliy Slobodin 639e8c85b2 Make QNetworkReplyHandler deliver content asynchronously
when its load type is set to SynchronousLoad.

Issue #11338: https://github.com/ariya/phantomjs/issues/11338
Upstream bug: https://bugs.webkit.org/show_bug.cgi?id=62808
2013-05-20 19:49:23 -07:00
Vitaliy Slobodin 0726a8e2bb Fix crash when calling QObject::disconnect for QNetworkReplyWrapper
Fix it by watching the QNetworkReply's destroyed() signal and avoid the dangling pointer
instead. The QNetworkReply doesn't need to be aborted in this case anyway.

Issue #11252: https://github.com/ariya/phantomjs/issues/11252
Upstream bug: https://bugs.webkit.org/show_bug.cgi?id=116035
2013-05-19 12:01:33 -07:00
Vitaliy Slobodin 5528d75c9d Network request header manipulation
Issue: https://github.com/ariya/phantomjs/issues/11299 (#11299)

User should be able  to manipulate HTTP headers per each network request, not only using global setting page.customHeaders.
2013-05-13 22:48:58 -07:00
Vitaliy Slobodin f8e79fb8c6 Limit the maximum request post size to 10 MB (megabytes).
std::numeric_limits<qint64>::max is too big for QByteArray (throws Out of Memory exception).
Set up the limit like it was done in Google Chrome
Ref: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp

Related to issue #10158 https://github.com/ariya/phantomjs/issues/10158
2013-05-13 22:41:15 -07:00
Ivan De Marino 23515550d5 MINOR: Reorder initialisation order in NAM constr.
`m_resourceTimeout` is declared before of other
private variables, and the compiler was complaining
the initialisation order could not be respected.
This caused annoying (but innocuous) warnings at compile time.
2013-04-30 22:57:58 +01:00
Andrew Galloni 3ae632e704 ChangeUrl to accept an encoded string
Issue #11243: https://github.com/ariya/phantomjs/issues/11243.
2013-04-29 07:07:53 -07:00
execjosh 39bec1ce17 Synchronize std{in,out,err} encoding with `Terminal`
See #11234 https://github.com/ariya/phantomjs/pull/11234
Spin off from #11168 https://github.com/ariya/phantomjs/pull/11168
2013-04-29 07:00:47 -07:00
execjosh b159144a48 Teach `File` how to change its encoding
If a `File` is in "text" mode, then it has an encoding.  This
encoding defaults to UTF-8; however, it can be set only at time of
construction (by using `fs.open`).

This modification allows the user to change the encoding on-the-fly
for "text" mode `File` instances.

See #11234 https://github.com/ariya/phantomjs/pull/11234
Spin off from #11168 https://github.com/ariya/phantomjs/pull/11168
2013-04-29 07:00:19 -07:00
execjosh 3d874d9e0d Make `Terminal` emit a signal upon encoding change
See #11234 https://github.com/ariya/phantomjs/pull/11234
Spin off from #11168 https://github.com/ariya/phantomjs/pull/11168
2013-04-29 06:58:44 -07:00
execjosh f8a905c8b0 Link with text codec plugins on mac and linux
Fixes [#10249](https://github.com/ariya/phantomjs/issues/10249)
2013-04-22 22:35:56 -07:00
Vitaliy Slobodin 3edcabef9f Fix compilation with MSVC 2010
Issue #10158: https://github.com/ariya/phantomjs/issues/10158
This bug introduced by the marco max( ) defined in <windef.h>.
It replaces max( ) with another statement but still preceeded by numberic_limits<Type>::
The workaround is to use the parenthesis
2013-04-13 20:17:12 -07:00
Vitaliy Slobodin 78242e5d6c Fix command line option typo
Issue #11219: https://github.com/ariya/phantomjs/issues/11219
2013-04-12 23:12:20 -07:00
execjosh 36ab7194e4 Use UTF-8 encoding for std{in,out,err}
This fixes issue #11162.

`File` constructor takes a `QTextCodec *`, codec; but, if codec is
`NULL`, then it assumes "binary" mode, which causes non-ASCII
characters to be converted to NUL (`\0`) in `File::write`.

This change passes the codec for UTF-8 to the `File` constructor for
the `std{in,out,err}` instances, thus opening them in *text mode*.
2013-04-12 23:10:25 -07:00
execjosh 8042f3b92c Flush in `File::write` when in unbuffered "text" mode
If the wrapped `QFile` was opened with `QIODevice::Unbuffered`, any
writes should be unbuffered.  However, as currently implemented,
using `QTextStream` when the `File` is in "text" mode causes all
reads/writes to be buffered.

This modification forces a flush in `File::write` if the wrapped
`QFile` was opened with `QIODevice::Unbuffered`.

Necessary to fix issue #11162 https://github.com/ariya/phantomjs/issues/11162.
2013-04-12 23:10:08 -07:00
Ariya Hidayat 0bc2eb418e Temporarily call this branch as version 1.10.
Issue #10448 https://github.com/ariya/phantomjs/issues/10448#issuecomment-15689386
2013-03-31 03:06:50 -07:00
Pavel fcdd274f2e Show postData in onResourceRequested callback.
Issue #10158 https://github.com/ariya/phantomjs/issues/10158
2013-03-31 02:54:37 -07:00
Vitaliy Slobodin 47dc82681d Fire `onResourceReceived` callback when the resource error occured.
Issue #11163: https://github.com/ariya/phantomjs/issues/11163
2013-03-31 02:39:53 -07:00
Vitaliy Slobodin 9ca45ed62e Fix loading modules from an absolute path on Windows.
Don't check the module path using Linux-style path checking.

Issue #11165: https://github.com/ariya/phantomjs/issues/11165
2013-03-25 19:01:32 -07:00
Ariya Hidayat bda3355060 Issue #10939: Get ready for version 1.9.0.
https://github.com/ariya/phantomjs/issues/10939
2013-03-20 22:23:51 -07:00
Jonathan Wilkins 9f9053ec44 Add support for specifying non-default CA certificate bundles.
This is done via SSL_CERT_DIR and --ssl-certstore.

Fixes issue #10916.

https://github.com/ariya/phantomjs/issues/10916
2013-03-20 08:27:54 -07:00
Tom Aizenberg 52883ced68 WebPage: network timeout setting.
Fixes issue #11129.

https://github.com/ariya/phantomjs/issues/11129
2013-03-19 22:57:26 -07:00
Laurent Jouanneau b16a5348a9 WebPage: new constants for modifiers keys
Declares in event.modifiers all constants needed for the fifth
parameter of sendEvent.

http://code.google.com/p/phantomjs/issues/detail?id=1056
https://github.com/ariya/phantomjs/issues/11056
2013-03-18 22:24:02 -07:00
Max Desyatov 357dbf46d2 Support for specifying request body encoding for WebPage::openUrl
doesn't break existing functionality and currently supports only
"utf-8" and "utf8" encodings

Fixes http://code.google.com/p/phantomjs/issues/detail?id=1043
2013-03-18 21:43:00 -07:00
Ivan De Marino 78d90641df Importing new GhostDriver 1.0.3.
See the https://github.com/detro/ghostdriver/ project for details.
2013-03-18 09:20:50 +00:00
Ivan De Marino 9740990990 New "page.loading" and "page.loadingProgress".
Now you can know about the Page Loading Progress
using 2 property:
- [bool] page.loading
- [int: 0-100] page.loadingProgress

Implements #1091: http://code.google.com/p/phantomjs/issues/detail?id=1091
2013-03-17 16:24:47 +00:00
Ariya Hidayat 9af1f09f58 Change issue tracker link to point to the new one.
From now on, it's https://github.com/ariya/phantomjs/issues.

For the details, check this mailing-list discussion:
https://groups.google.com/d/msg/phantomjs/It04OsP7csU/Vw2cmJkAILUJ
2013-03-16 09:19:25 -07:00
Vitaliy Slobodin fed209c546 Allocate JsNetworkRequest on the stack to avoid leaking it.
https://code.google.com/p/phantomjs/issues/detail?id=539
2013-02-24 09:00:49 -08:00
Vitaliy Slobodin 212e4b7cd9 Reworked api for canceling network requests. Added experimental API for changing the url of the network request.
Issue:
http://code.google.com/p/phantomjs/issues/detail?id=539

Stub
2013-02-24 09:00:07 -08:00
Ivan De Marino 04368c6af8 HOTFIX: @Vitalliumm discovered a typo in CookieJar
Original message: https://twitter.com/vitalliumm/status/301220038323613697
This was affecting date comparison/espiration in the
CookieJar.

Typical case of "I have no idea how it did work so far".

http://code.google.com/p/phantomjs/issues/detail?id=1068
2013-02-12 07:34:57 -08:00
Juliusz Gonera 2d42b52c67 Make require.stub() optionally accept a factory function
require.stub() can now accept a factory function instead of an object
so that stubbed modules are initialized lazily:

require.stub('zlib', function() {
    // initialized once, when zlib first required
    return {
        createGzip: function() { ... }
    };
});

http://code.google.com/p/phantomjs/issues/detail?id=1044
2013-02-05 00:04:17 -08:00
Julian Szulc 1e5638678d Fix ignoring ssl errors on synchronous xhrs
disabling peer verify in ssl configuration when ignore-ssl-errors is set

issue http://code.google.com/p/phantomjs/issues/detail?id=985
2013-02-05 00:01:50 -08:00
James M. Greene 1604b4d6c1 Updated help output to prefer true/false to yes/no
Similarly, I updated the API Reference too:
7cddd19676

This arguably makes more sense to PhantomJS's typical audience of web developers.
2013-02-04 23:58:10 -08:00
Ariya Hidayat 43ab20d4ae Prevent possible crash on pages with iframes.
In some cases, setupFrame() has not been invoked (due to the queued
signal-slot connection) after the frame is destroyed and thus leads
to the crash. We prevent this from happening by making sure it is a
direct connection instead and therefore setupFrame() will be executed
as soon as possible.

Investigation + patch by Vitaliy Slobodin <vitaliy.slobodin@gmail.com>.

http://code.google.com/p/phantomjs/issues/detail?id=947
2013-01-28 21:13:47 -08:00
Jeff Boulter ec6b242a9f Fixed the CreationDate value format when creating PDFs.
This was confusing Adobe Reader and not allowing it to save PDFs.

This bug appears to have been introduced in commit 08fc50d149 which was applying the patch from http://qt.gitorious.org/qt/qt/merge_requests/706 but missed two lines.

This should fix issue http://code.google.com/p/phantomjs/issues/detail?id=663 .
2013-01-25 00:12:06 -08:00
bongole 0734811514 Add rendering to stdout and stderr.
This feature renders PDF, GIF and other format supported by Qt to
stdout or stderr.

*NOTE*
"/dev/stdout" and "/dev/stderr" are converted to System::stdout and
System::stderr on Windows.

Issue: https://code.google.com/p/phantomjs/issues/detail?id=973
2013-01-21 21:44:18 -08:00
Vitaliy Slobodin 6d81933941 Pass the resource URL to the resourceError handler.
http://code.google.com/p/phantomjs/issues/detail?id=997
2013-01-21 21:42:10 -08:00
Ivan De Marino 4dec091ac2 FIX: Check file exist when attempting upload.
Both "page.uploadFile()" and "onFilePicker = function() {}" check file exists before accepting them.
If file don't exists, they are "ignored".

Fixes issue #941: https://code.google.com/p/phantomjs/issues/detail?id=941
2013-01-17 23:45:34 +00:00
Vitaliy Slobodin a7a3928af9 Fix compilation on Windows.
We need to include QtCore/qt_windows.h on Windows since Q_PID mapped to
_PROCESS_INFORMATION, but _PROCESS_INFORMATION not defined.

Issue:
http://code.google.com/p/phantomjs/issues/detail?id=219
2013-01-16 08:00:52 -08:00
James M. Greene 1a487d2bbf Added myself to the copyright list 2013-01-16 08:00:51 -08:00
James M. Greene 360dc3a30c Corrected default value for disk-cache help
Fixes http://code.google.com/p/phantomjs/issues/detail?id=908
2013-01-16 08:00:51 -08:00
Ariya Hidayat d58eae54d7 Ensure we describe onNavigationRequested behavior properly.
http://code.google.com/p/phantomjs/issues/detail?id=562
2013-01-09 20:26:55 -08:00
Oleg Pudeyev 26e51f4b8a -ldl is needed only on Linux, not on all Unices.
In particular on FreeBSD there is no -ldl as the respective
functionality is in -lc.

http://code.google.com/p/phantomjs/issues/detail?id=597
2013-01-09 00:07:36 -08:00
Oleg Pudeyev 52e67c5aa7 Use bash from PATH rather than hardcoded in /bin.
E.g. FreeBSD has bash in /usr/local.

http://code.google.com/p/phantomjs/issues/detail?id=597
2013-01-09 00:06:58 -08:00
Vitaliy Slobodin 09e929d599 Allow to abort network requests.
Issue: http://code.google.com/p/phantomjs/issues/detail?id=230
2013-01-04 23:39:23 -08:00
Vitaliy Slobodin fd700b0702 New WebPage callback: onResourceError.
This callback is invoked when the WebPage was unable to request the resource

Issue: http://code.google.com/p/phantomjs/issues/detail?id=954
2013-01-04 21:24:30 -08:00
execjosh d906bc3819 Automate lazy generation of REPL completion lists
All invokable methods, slots, signals, and properties visible from
JavaScript, but which do not start with an underscore, are lazily
(only when necessary) added to the completion list through dynamic
reflection.

This leverages `QMetaObject` for reflection of `QObject`s.  As such,
there is now no need to inherit `REPLCompletable` and it has been
removed.

http://code.google.com/p/phantomjs/issues/detail?id=943
2013-01-04 21:23:58 -08:00
Ariya Hidayat d0fe6864a9 Mac OS X: Fix possible crash when using some TrueType fonts.
This is just a workaround. We simply avoid removing the custom font
(intentionally leak it, a small price to pay) because otherwise it will
invalidate Qt's font cache, which in turns trigger the crash at
CoreText's CTFontCopyGraphicsFont.

http://code.google.com/p/phantomjs/issues/detail?id=690
2012-12-30 21:17:40 -08:00
execjosh f52044cd31 Emulate spawn and execFile from node.js's child_process module
This is a rudimentary implementation of the following methods
from [node.js's `child_process` module][1]:

 *  `spawn`
 *  `execFile`

The examples are relevant only for *nix operating systems...

The following methods are Not Yet Implemented™:

 *  `exec`
 *  `fork`

[1]: http://nodejs.org/docs/v0.8.16/api/child_process.html

http://code.google.com/p/phantomjs/issues/detail?id=219
2012-12-29 01:03:08 +09:00
execjosh 836719f72e Implement CommonJS IO/A read([n Number])
The [IO/A spec][1] for `read` is as follows:

> Read up to n bytes from the stream, or until the end of the stream
> has been reached. [If] n is null, reads up to the block size of the
> underlying device, or up to 1024 bytes if the block size is not
> discernible. If n is not specified, this method always reads the
> full stream until its end is reached. ...

Since discovering the block size of the underlying device is
non-trivial, we will just default to 1024.

**NOTE**

The initial implementation of `File::read()` saves the current
(original) position, seeks to the beginning of the stream,
`readAll`s to the end, and then resets to the original position.

  I think that this behavior is unexpected and should be changed--it
should read from the current position to the end of the stream and
stay there.  The user should explicitly `seek` to the beginning of
the stream when necessary.

  With the current implementation, the user should note that the
position *will not change* after calling `read()` with no arguments.

[1]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods

http://code.google.com/p/phantomjs/issues/detail?id=938
2012-12-25 20:46:14 -08:00
execjosh 6bc3a93118 Add `seek` method to `File` class
This method is necessary for random-access streams.  It will also be
helpful in the future when implementing the [IO/A spec][1].

[1]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods

http://code.google.com/p/phantomjs/issues/detail?id=937
2012-12-25 13:11:20 -08:00
execjosh f6c87221a7 Implement system.std{in,out,err}
See [issue 333][1] and pull request #192.

**Caveat**

`File::read` currently takes no parameters and is equivalent to a
"`readAll`".  This will be changed later to match [IO/A Spec's
`Stream#read`][2]; but, should still be noted.

[1]: http://code.google.com/p/phantomjs/issues/detail?id=333
[2]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods
2012-12-25 03:41:34 -08:00
Ariya Hidayat 3f42fb230f Linux: Ensure we use 72 dpi.
For our QPA/Lighthouse platform screen, apparently we need to specify the
physical screen size because otherwise the default 100 dpi will be used.

This also brings font rendering on headless Linux to 72 dpi.

http://code.google.com/p/phantomjs/issues/detail?id=659
2012-12-23 12:03:10 -08:00
Ariya Hidayat fac15407e8 Call the development branch as version 1.9. 2012-12-23 08:57:37 -08:00
execjosh 03500e6b55 Implement fs.{split(path),join(...),{to,from}NativeSeparators}
For fs.{split,join} specs, see: http://wiki.commonjs.org/wiki/Filesystem/A#Paths_as_Text

http://code.google.com/p/phantomjs/issues/detail?id=361
2012-12-22 23:05:46 -08:00
Ivan De Marino d998c59358 Importing GhostDriver v1.0.2.
Changes listed here: https://github.com/detro/ghostdriver/issues?labels=1.0.2&page=1&state=closed
2012-12-19 19:29:54 -08:00
Ariya Hidayat 8836398825 Generalize WebServer binary data handling into a real encoding support.
http://code.google.com/p/phantomjs/issues/detail?id=505
2012-12-17 23:12:48 -08:00
Sebastian Krzyszkowiak 78e72312dc Implement WebServerResponse::setEncoding in order to allow binary encoding to be sent.
Fixes http://code.google.com/p/phantomjs/issues/detail?id=505
2012-12-17 19:27:06 -08:00
Ivan De Marino 302050e0ce Fixing typo in GhostDriver 1.0.1 2012-12-17 19:15:43 -08:00
David Burrows 15fe514025 Increase maximum number of redirects in line with modern browsers.
Modern browser mostly limit re-directs to 20. The current limit in  PhantomJS is 10 which is not in line with most browsers. This patch is a simple increase of gMaxRedirections from 10 to 20.

http://code.google.com/p/phantomjs/issues/detail?id=849
2012-12-16 22:21:07 -08:00
qubird f6a91a8813 New WebPage#setContent api - makes possible to specify location along with content
http://code.google.com/p/phantomjs/issues/detail?id=909
2012-12-16 15:43:10 -08:00
Ivan De Marino 027aa93b18 Importing GhostDriver version `1.0.1`.
Changes are documented here:
https://github.com/detro/ghostdriver/issues?labels=1.0.1&state=closed.

https://github.com/detro/ghostdriver/issues/130
2012-12-16 13:55:58 -08:00
Ivan De Marino f5652e5110 Fix "--webdriver-selenium-grid-hub" CLI parameter.
I had forgotten to update the option parsing code,
and the option was never picked.

Related issue: [GhostDriver #130](https://github.com/detro/ghostdriver/issues/130).
2012-12-13 23:45:54 -08:00
Vitaliy Slobodin 04b74f99fd Enable WOFF file support.
Background:
WOFF format requires that WebKit should be compiled with zlib.

Related issues:
http://code.google.com/p/phantomjs/issues/detail?id=592
2012-12-12 21:42:58 -08:00
Jon Leighton eb3c9caa6e Upgrade to Qt 4.8.4
http://code.google.com/p/phantomjs/issues/detail?id=918
2012-12-12 21:42:45 -08:00