Thursday, May 24, 2012

"Unsafe JavaScript attempt to access frame with URL…' error being continuously generated in Chrome webkit inspector


Chrome (or any other webkit browser) throws a ton of these "Unsafe JavaScript attempt to access frame with URL..." when working with the Facebook API for example.



It doesn't interfere with actual operation, but it does make the javascript console basically unusable.



I'd like to know if there is a way to suppress these errors specifically in the console? Or if there are other solutions you guys can think of, I would really appreciate it.



Thanks.


Source: Tips4all

5 comments:

  1. You could allow cross-domain requests during testing by running chrome with the --disable-web-security command line option. This should probably get rid of the error (and allow FB to spy on your testing ;)

    ReplyDelete
  2. This happens with way more than just Facebook. Grab the boilerplate embed code from, say, Vimeo (the new iframe stuff, not the old object stuff), or even Google Maps. You will get the same errors.

    ReplyDelete
  3. Since we can't blame the people from Google for constructing such a safe browser, I think the best solution is to use Facebook's server-side solutions (e.g. PHP SDK), it'll save you a lot, lot, lot, lot, lot of headache. The only advantage I see in using the FB javascript SDK is the popup login which you can do yourself using javascript/jQuery.

    ReplyDelete
  4. This happens when a source from an different domain is loaded and tries to access the document.cookie. It happens with head sources (script tags) as well with iframe documents which try to access the document.cookie for some reason.

    ReplyDelete
  5. These errors can be thrown if, when you register the app with facebook, you don't have a trailing slash in the Site URL field.

    ReplyDelete