screencap icon indicating copy to clipboard operation
screencap copied to clipboard

Use system.args if phantom.args is undefined

Open nathanvda opened this issue 9 years ago • 4 comments

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.

nathanvda avatar Jan 31 '16 23:01 nathanvda

From the documentation: http://phantomjs.org/api/phantom/property/args.html

nathanvda avatar Jan 31 '16 23:01 nathanvda

Note that this was added also in my open PR https://github.com/maxwell/screencap/pull/28

DEfusion avatar Feb 01 '16 03:02 DEfusion

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.

nathanvda avatar Feb 01 '16 08:02 nathanvda

I confirm this works with phantom 2.1.1 on archlinux!

Please merge!

Thank you!

nofxx avatar Mar 14 '16 20:03 nofxx