2017-09-04 71 views
1

我使用Facebook登录在我的网站。我正在测试Firefox 55.0.3(64位)。Facebook登录不上的Firefox浏览器只

要正确调试它,我已经创建一个新的空白索引页,就像这样:

<script> 
    window.fbAsyncInit = function() { 
     FB.init({ 
      appId: 'mypersonalID', 
      cookie: true, 
      xfbml: true, 
      version: 'v2.8' 
     }); 
     FB.AppEvents.logPageView(); 
    }; 

    (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/pt_BR/sdk.js"; 
     fjs.parentNode.insertBefore(js, fjs); 
    }(document, 'script', 'facebook-jssdk')); 

    function myClick() { 
     console.log('click'); 
     FB.getLoginStatus(function (response) { 
      console.log(response); 
     }); 
    } 
</script> 

<button onclick="myClick()">Debug</button> 

当在Chrome,边缘,浏览器等测试它。该控制台但是能正常打印, ,在Firefox上,我只能看到控制台click,但从来没有从Facebook事件的响应,也没有得到任何错误。

我不知道什么可能发生的情况,但这只是没有在Firefox上运行。

如果我打电话的FB.login()弹出的显示出来,但在取消或确认登录,查看刚刚转白,永远不会关闭或返回的承诺。


编辑:我试图在Firefox私密模式下运行它,现在我可以看到这个错误:

The feature at " http://connect.facebook.net/en_US/sdk.js " has been blocked because tracing protection is enabled.

穿上还是不知道如何解决这个问题。

回答

2

这是一个特点,就是Firefox独有的。你可以找到如何在私人模式停用此功能的信息:

https://blog.mozilla.org/futurereleases/2015/09/23/help-test-private-browsing-with-tracking-protection-in-firefox-beta/

您还可以阅读更多的在Firefox跟踪保护,以及它如何能在这里打破网站:

https://developer.mozilla.org/en-US/Firefox/Privacy/Tracking_Protection

+0

那意味着我无法解决这个问题?因为我习惯于使用其他网站,比如Airbnb和新闻门户网站,以前从未发生过。 – celsomtrindade

+0

只需禁用该功能在Firefox – SDH

+0

但我会在我的电脑只能这样做。那么其他用户将访问我的网站并尝试使用此服务呢?如果他们没有禁用它,它也会被破坏。这是我想要避免的。 – celsomtrindade