question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting "Unsafe JavaScript attempt to access frame" when running specs from the command line

See original GitHub issue

I get error running bundle exec rake spec:javascript

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///Users/fifigyuri/proj/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/assets/javascripts/jasmine-runner.js. Domains, protocols and ports must match.

The specs pass from the browser without any error showing up in the console, but they fail with the above error from command line. It seems like some CORS error.

I use phamtonjs 1.9.8, the lastest jasmine-rails.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
chrissun-gscommented, Jan 12, 2016

@jasper-lyons Thanks for the tip.
After updating jasmine.yml with your suggested change, I’m no longer seeing “Unsafe JavaScript attempt …”.

0reactions
jasper-lyonscommented, Dec 23, 2015

I know this is closed but for anyone looking for a cleaner solution:

  1. add this to your jasmine.yml
use_phantom_gem: false

This will cause jasmine-rails to use the system defined phantomjs command

  1. install phantomjs 2.0

Mac \w homebrew:

brew install phantomjs
Read more comments on GitHub >

github_iconTop Results From Across the Web

"Unsafe JavaScript attempt to access frame with URL..." error ...
I tried this from the command line: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security and it seemed to work! but it said it ...
Read more >
39561 - "Unsafe JavaScript attempt to access frame with URL ...
I've attached a sample html frameset which displays the problem when run in Chrome, but not in Firefox or IE. I think that...
Read more >
What is Cross-site Scripting and How Can You Fix it? - Acunetix
This article will show you how Cross-site Scripting attacks work and how you can use Acunetix WVS to protect your website against them....
Read more >
Chrome error "Unsafe JavaScript attempt to access frame with ...
My org has installed a managed package that contains a Home Page component that defines an HTML area. The HTML for the component...
Read more >
Node.js v19.3.0 Documentation
allocUnsafe (). The --zero-fill-buffers command-line option; What makes Buffer. ... Enabling; Accessing the main module; Package manager tips ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found