Casperjs And 'unsafe Javascript Attempt To Access Frame With Url' Error
Solution 1:
Recent PhantomJS (1.9.8) introduced this error message. It doesn't cause any real issue, other than confusing log lines when quiting PhantomJS.
It is fixed in unreleased 1.9 branch: https://github.com/ariya/phantomjs/pull/12720
Solution 2:
This issue is fixed in phantomjs version 1.9
"phantomjs": "^1.9.9"
for casperJs
casperjs --ssl-protocol=tlsv1 test run.js
Solution 3:
I was getting this same error, so I tried updating to phantomjs 1.9.9
(from 1.9.8
). However, I was getting an install error when trying to install 1.9.9
, so I down rev-ed to phantomjs 1.9.7
, and that fixed this error for me. So, it seems like this is an issue introduced in phantomjs 1.9.8
.
Solution 4:
Hey there are several workarounds to try and get around this by exiting phantom in a different way such as
casperjs --ssl-protocol=tlsv1 test run.js
WHICH DOSE NOT HELP and
setTimeout(function(){
phantom.exit();
}, 0);
instead of
this.exit();
Nothing has worked!!!
I tried several different versions of PhantomJS. My output comes in as JSON and after many hours of failed attempts of JSON.parse(stdout)I had to give up. I figured 'F' it I'm just going to handle the 'F'ing error.
so simple before i exit i
this.echo(',{"error":"');
and After I send
this.echo('"}]');
When i get my results back i simply replace all the line breaks and ignore the error
stdout = stdout.replace(/(?:\r\n|\r|\n)/g, '');
Side note: this problem was tried to be fixed with phantom 1.9.9 but instead the focussed on building phantom 2.0 which is not compatible with CasperJS
Post a Comment for "Casperjs And 'unsafe Javascript Attempt To Access Frame With Url' Error"