Facebook Authentication - Unsafe JavaScript attempt to access frame with URL

后端 未结 7 1161
别那么骄傲
别那么骄傲 2021-01-11 20:14

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 JavaScri         


        
7条回答
  •  清酒与你
    2021-01-11 20:37

    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=&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.

提交回复
热议问题