* "phantom.loadJs()" loads a JS file and executes it's content within the current Document Context. It's synchronous.
* "phantom.includeJs()" adds a <script> tag include. It's asynchronous and accepts as second parameter a "callback", fired when the js file has been loaded.
* Some more qDebug() calls
* qDebug() output disabled by default in the .pro file
NOTE: I'm adding qDebug() calls to make development of phantomjs easier and "debuggable"
* 'phantom.simulateMouseClick' accepts a 'selector' and clicks on every element that matches the selector
* Added a couple of 'qDebug()' to help debugging PhantomJS
* Now the "usage" shows all the options that are currently supported by phantomjs from the command line
* The default behaviour for the option "--load-plugins" is now fixed (to "no")
For example, the argument to allow file upload now is part of
phantomjs invocation:
phantomjs --upload-file tag=/path/to/file script.js A B C
which means script.js only "sees" A, B, C in phantom.args array.
pass --upload-file fileTag=/path/to/file as an argument and set the file of <input type="file" id="foo"/> by calling phantom.setFormInputFile(document.getElementById('foo'), 'fileTag');
Filling QImage with transparent white instead of transparent
black. For an artifact free rendering of a transparent web
page into PNG, Format_ARGB32 is needed instead of
Format_ARGB32_Premultiplied.
If the javascript calls phantom.exit(), and afterwards
phantom.open(), if may happen that the open() triggers a
loadFinished() signal happens after Phantom was destroyed.
Result: Crash in Phantom::finish().
Workaround: Disconnect from loadFinished() when exit() is
called.
Was caught in exec(). Apparently, on Windows an exit()
cannot be scheduled before exec was called. Since
a timer based exit was already implemented, use that.