Facebook Uncaught SecurityError [英] Facebook Uncaught SecurityError

查看:80
本文介绍了Facebook Uncaught SecurityError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在寻找一个Facebook的JavaScript应用程序。因此,我只是将文档中的文档复制到我的页面中,并在控制台中收到以下错误:

I'm currently looking to make a Facebook JavaScript App. As such I'm literally just copy pasting out of the docs into my page and I keep getting the following errors in the console:

Uncaught SecurityError: Blocked a frame with origin "http://static.ak.facebook.com" from accessing a frame with origin "http://localhost:8080". Protocols, domains, and ports must match. VM2813:1
Uncaught SecurityError: Blocked a frame with origin "https://s-static.ak.facebook.com" from accessing a frame with origin "http://localhost:8080".  The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
 VM2817:1
Uncaught SecurityError: Blocked a frame with origin "http://static.ak.facebook.com" from accessing a frame with origin "http://localhost:8080". Protocols, domains, and ports must match. 

因此,我再查看添加 http:// localhost:8080 到我的Facebook应用页面,但我仍然遇到相同的错误。

As such I then looked to add http://localhost:8080 to my Facebook app page and yet I'm still getting the same error.

这是我使用的代码:

<body>

    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : '644205045632878',
          status     : true,
          xfbml      : true
        });
      };

      (function(d, s, id){
         var js, fjs = d.getElementsByTagName(s)[0];
         if (d.getElementById(id)) {return;}
         js = d.createElement(s); js.id = id;
         js.src = "//connect.facebook.net/en_US/all.js";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));
    </script>
</body>

请有人解释这里有什么问题。这是我第一次这样做...

Please can someone explain what is wrong here. This is my first time doing this...

推荐答案

如果您使用安装了Ripple模拟器的 Chrome进行测试当您看到这些错误消息时,请尝试禁用Ripple(从设置,而不仅仅是特定页面)。显然,即使没有为特定页面启用Ripple,它会拦截响应并阻止。

If you are testing with Chrome with the Ripple emulator installed when you see these error messages, try disabling Ripple (from settings, not just for the particular page). Evidently even when Ripple isn't enabled for a particular page, it intercepts the response and gets in the way.

我在Windows 7上观察到Chrome版本34.0.1847.131 Pro 64位与Ripple Emulator(Beta)0.9.15扩展安装并启用。

I observed this with Chrome version 34.0.1847.131 on Windows 7 Pro 64-bit with the Ripple Emulator (Beta) 0.9.15 extension installed and enabled.

这篇关于Facebook Uncaught SecurityError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆