1

On each test run of casperjs test, the output closes with the following:

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///usr/lib/node_modules/casperjs/bin/bootstrap.js. Domains, protocols and ports must match.

My tests pass. Everything else looks okay, but is this block of text important? Does it suggest that I set something up incorrectly.

Even running a command as below shows the same message.

$ casperjs --version
1.1.0-beta3
Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///usr/lib/node_modules/casperjs/bin/bootstrap.js. Domains, protocols and ports must match
Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Rick
  • 591
  • 1
  • 9
  • 23

2 Answers2

1

From the comments to the original question, I downgraded phantomjs

sudo npm -g install phantomjs@1.9.7-15

This remedied that output. However, I still don't have enough knowledge to be able to explain why. If anyone does, I'm happy to mark that as the correct answer.

Rick
  • 591
  • 1
  • 9
  • 23
1

Richard,

Apparently, the problem is related to the safety of this request when opening about: blank.

Many of the problems faced in abrri a specific URL and potential security problems, I managed to solve by adding the following code in ALL my scripting calls:

casperjs --web-security=no --ssl-protocol=any --ignore-ssl-errors=yes test C:\path_test\file_test.js

Why in all the executions? In most tests that do, my URLs are https and even on things on the type http, my play with the above code did not work problems and my goal in the project, I had no problem and solved these safety issues.

Take the test and see if it resolves your problem, it still does not work, maybe we can "debug" if not missing something related to CasperJS or PhantomJS, something related to machine configuration, permissions, user, etc.

Diego Borges
  • 342
  • 3
  • 7
  • 1
    Excellent suggestion. Upvote. I put all these test inside a shell file anyway so that I can literally type `$ ./runtest.sh` and everything starts going. Adding these to a shell file (once) will help. Much appreciated. I test fire-walled development and staging servers from within the same network. – Rick Jun 19 '15 at 14:22