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 #4

Open
christianalfoni opened this issue Oct 30, 2014 · 6 comments
Open

Unsafe JavaScript attempt #4

christianalfoni opened this issue Oct 30, 2014 · 6 comments

Comments

@christianalfoni
Copy link

Hi,

Great work on this!

When running the tests everything seems to work, but I get the following message 4 times after the result:

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://src/jasmine2-runner.js. Domains, protocols and ports must match.

You know why that is? Kinda annoying :-)

@sandermak
Copy link
Owner

Thanks for trying it out! I don't see these errors. Can you provide some reproduction steps (also what browser/environment etc.) using the example/specrunner.html in this repo?

@forrestli74
Copy link

the same thing happened to me.
I tried using a few commits back. same error happened.
i have no x-window, ubuntu 12.04
here is what I did: (based on memory)

git clone ssh://github.com/sandermak/jasmine2-junit.git
sudo install -g phantomjs
cd jasmine2-junit
cd example
phantomjs ../src/jasmine2-runner.js specrunner.html

here is the error:

Loading specrunner.html
Jasmine ran in  0.007  seconds
7 specs, 2 failures, 1 pending spec
Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://../src/jasmine2-runner.js. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://../src/jasmine2-runner.js. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://../src/jasmine2-runner.js. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://../src/jasmine2-runner.js. Domains, protocols and ports must match.

@christianalfoni
Copy link
Author

Hi @sandermak, this is my setup:

PhantomJS: 1.9.12
OSX: Yosemite

specrunner.html:

<!DOCTYPE html>
<html>
<head>
  <title>Jasmine Test Runner</title>
  <link rel="shortcut icon" type="image/png" href="jasmine/lib/jasmine-2.0.3/jasmine_favicon.png">
  <link rel="stylesheet" type="text/css" href="jasmine/lib/jasmine-2.0.3/jasmine.css"> 

  <script type="text/javascript" src="jasmine/lib/jasmine-2.0.3/jasmine.js"></script>
  <script type="text/javascript" src="jasmine/lib/jasmine-2.0.3/jasmine-html.js"></script>
  <script type="text/javascript" src="jasmine2-junit/jasmine2-junit.js"></script>
  <script type="text/javascript" src="jasmine2-junit/boot.js"></script>

  <script type="text/javascript" src="vendors.js"></script>
  <script type="text/javascript" src="specs.js"></script>

</head>
<body>

</body>
</html>

I would expect this to be a phantomJS problem though. I played around with the code and there is something at "onInitialized" that causes this. Just adding an empty function to it causes the problem to occur. Maybe report it to phantomJS team? Or maybe dynamically create an inline javascript inside jasmine2-runner that loads before everything else, with the key and path separator thingy?

I could have a go at that this weekend, let me know :-)

@sandermak
Copy link
Owner

I'm running this with PhantomJS 1.9.7 on Mavericks and don't see it, so it seems like a change in PhantomJS triggers this. I'd be happy to merge a PR that fixes this for you (given that it doesn't break existing usecases of course).

@christianalfoni
Copy link
Author

Ah, that would be awesome @sandermak. Its the last small thing of this React JS boilerplate I have been working on. Check it out if you want: https://github.com/christianalfoni/react-app-boilerplate.

@timc3
Copy link

timc3 commented Jun 16, 2015

Also seeing this with PhantomJS 1.9.8

ariya/phantomjs#12697

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

4 participants