screencap
screencap copied to clipboard
Use system.args if phantom.args is undefined
In phantomjs versions > 2.0 phantom.args
is
no longer supported, and we should use system.args
instead.
When I installed screencap on my dev machine, it just worked, but somehow when deploying on my clients windows server it did not work. I got an error on phantom.args
being undefined, and when looking it up, I found it is no longer used in the new versions (>2.0). We should use system.args
instead. For me this version works on both my dev machine and windows server.
The code should still work for lower versions as well.
From the documentation: http://phantomjs.org/api/phantom/property/args.html
Note that this was added also in my open PR https://github.com/maxwell/screencap/pull/28
Hi @DEfusion indeed, but your branch has not yet been merged, so I assumed the rest of your branch was up for discussion, but this should be merged anyhow, so I imagined a "leaner" branch could get merged sooner.
I confirm this works with phantom 2.1.1 on archlinux!
Please merge!
Thank you!