Skip to content Skip to sidebar Skip to footer

Facebook Authentication - Unsafe Javascript Attempt To Access Frame With Url

I am trying to implement Facebook Login System into my website. While it try to connect to facebook, I get an error from console log: Unsafe JavaScript attempt to access frame with

Solution 1:

The error that you see there is a non-fatal error. There is no workaround for this, as your browser is advising you that it is not a great idea to load JavaScript from foreign domains. Just ignore this message and look elsewhere for bugs if your scripts do not run. Sajith is also correct that you can't debug from localhost.

See here also, "Unsafe JavaScript attempt to access frame with URL..." error being continuously generated in Chrome webkit inspector

Solution 2:

Be sure to have this line on the top of your page (it works for me) :

<htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:fb="https://www.facebook.com/2008/fbml">

Solution 3:

It is not possible to test all Facebook integration using domain localhost. You need to place your script in any public access domain and need to update the url in developer app settings page. The security error showing from JavaScript is due to this localhost access by facebook scripts

Solution 4:

You can only use the same domain name in which you have registered with Facebook apps.

1. You need a public domain name (www.example.com).
2. You need to register with Facebook apps.
3. Get the 2 keys from the Facebook and use in the code:
    appId      : 'xxxxxxxxxxxxxx',

Solution 5:

Had this error when I implemented fileglu and it may be a CORS error since you are running off localhost. Try running on Facebook and can you replace the bottom half with the code below:

(function() {
  var e = document.createElement('script');
  e.src = document.location.protocol + 
     '//connect.facebook.net/en_US/all.js#appId=<your-app-id>&xfbml=1';
  e.async = true;
  document.getElementById('fb-root').appendChild(e);
}());

I also had Oauth 2.0 and custom channel enabled in my FB.init() page. See: http://fbdevwiki.com/wiki/FB.init for more information.

Post a Comment for "Facebook Authentication - Unsafe Javascript Attempt To Access Frame With Url"