Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe JavaScript attempt #167

Closed
3rd-Eden opened this issue Dec 17, 2014 · 18 comments
Closed

Unsafe JavaScript attempt #167

3rd-Eden opened this issue Dec 17, 2014 · 18 comments

Comments

@3rd-Eden
Copy link

Hey,

I've been trying to get this project running on my local machine. But every time I run the test suite I'm greeted by the following error:

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///Users/V1/Projects/unshiftio/url-parse/node_modules/mocha-phantomjs/lib/mocha-phantomjs.coffee. Domains, protocols and ports must match.

It might be related to 1.9.8 release of phantomjs: ariya/phantomjs#12697

@metaskills
Copy link
Collaborator

Interesting. I just checked master and ran the tests fine and I have 1.9.8 installed too. Thats not to say that this is not a problem, but I did not see it yet. Looking for others to chime in.

@3rd-Eden
Copy link
Author

I also tried running my own tests using mochify and it works as intended. The tests that I was running against can be found here: https://github.com/unshiftio/url-parse/blob/master/test.js

@paulfalgout
Copy link

I'm also running into this issue, and here's someone else experiencing it as well via the gulp plugin.
https://github.com/mrhooray/gulp-mocha-phantomjs/issues/22

@andreialecu
Copy link
Contributor

I had this issue as well, but I resolved it by updating mocha.js to the latest version.

@erik-vanlankvelt
Copy link

I'm having the same issue. Also using gulp-mocha-phantomjs.

@nathanboktae
Copy link
Owner

Yes it is because of the above referenced phantomjs issue. I saw it while working on mocha-phantomjs-core too.

from what I've seen, forcing phantomjs@1.9.16 will get around this issue.

@mike-engel
Copy link

@nathanboktae I just tried to install phantomjs@1.9.16 in both the main project and inside mocha-phantomjs to no avail. I've also tried upgrade mocha, to no avail as well.

@erik-vanlankvelt
Copy link

Any progress on this? Not all my tests run due to this error.

@nathanboktae
Copy link
Owner

This is not an issue with mocha-phantomjs but phantomjs versions >= 1.9.8 < 2.0, as evidenced here by a CI run on mocha-phantomjs-core.

I'm going to be focusing on v4 that will move to phantomjs 2, so this will be resolved then. For now, you can force using an older version of phantomjs via the -p option if you are blocked.

@halcarleton
Copy link

@nathanboktae

from what I've seen, forcing phantomjs@1.9.16 will get around this issue.

Are you referring to forcing the npm package phantomjs to phantomjs@1.9.16? If so I tried this and it still installs version 1.9.8 of PhantomJS.

$ ./node_modules/phantomjs/lib/phantom/bin/phantomjs -v
1.9.8

Is there a workaround that will solve this until v2.0.0 is stable on linux?

@nathanboktae
Copy link
Owner

If so I tried this and it still installs version 1.9.8 of PhantomJS.

Correct I was mistaken.

Install phantomjs 1.9.16 yourself then use the -p option to use that phantomjs.

@halcarleton
Copy link

The npm package or the actual software?

I tried that with the npm package, and I don't see a v1.9.16 of PhantomJS.

I'll try building 1.9.7 from source and will report back.

@halcarleton
Copy link

Alright, I built PhantomJS 1.9.7 from source by following these instructions, except instead of git checkout 2.0 I used git checkout 1.9.7.

Then I changed the PhantomJS path in my mocha-phantomjs test command from ./node_modules/phantomjs/lib/phantom/bin/phantomjs to /usr/bin/phantomjs(which is a symlink).

This has fixed this issue for me.

@nathanboktae
Copy link
Owner

Alright, I built PhantomJS 1.9.7 from source

Ouch, there are built versions available for 1.9.7 FYI.

@halcarleton
Copy link

Hmm, I didn't see any information about built older versions on the PhantomJS website, or through a quick google search. The only pre-built versions I could find were 1.9.0(via apt-get install phantomjs) and 1.9.8(via npm install phantomjs).

Oh well, it only took around 40-60 min to build and my work day was already over anyways.

@Inviz
Copy link

Inviz commented Jul 15, 2015

Broke our Travis. Why would you do this in minor version? My problem is that I dont even control that, as it gets required via grunt-mocha-phantomjs intermediate

@nathanboktae
Copy link
Owner

Why would you do this in minor version

Right it shouldn't have been. My bad I'll revert the dependency version and republish, then publish a minor bump.

And in v4 it'll be a direct dependency avoiding the problem.

@nickp10
Copy link

nickp10 commented Jul 16, 2015

This change has caused an issue with the gulp-mocha-phantomjs module. I'm not entirely sure how the dependency versions are working, but gulp-mocha-phantomjs is allowing phantomjs 1.9.17, where this change is only allowing up to 1.9.15. This results in the following error:

npm ERR! peerinvalid The package phantomjs does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer mocha-phantomjs@3.5.4 wants phantomjs@1.9.1 - 1.9.7-15

The workaround is to explicitly reference phantomjs 1.9.15 in my package.json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants