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")
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
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.
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
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
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
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
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
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.
`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.
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
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*.
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 #11162https://github.com/ariya/phantomjs/issues/11162.
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
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
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
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
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
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_Methodshttp://code.google.com/p/phantomjs/issues/detail?id=938
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
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