我一直在网站上使用Facebook登录,直到收到一些有关它在Firefox上无法正常运行的问题.我正在Firefox 55.0.3(64位)上进行测试.
I was using Facebook login in my website until I received some issues about it not working properly on Firefox. I'm testing on Firefox 55.0.3(64-bit).
为了正确调试它,我创建了一个新的空白索引页面,如下所示:
To debug it properly, I've create a new blank index page, just like this:
<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/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,Edge,Explorer等上进行测试时.控制台可以正常打印,但是在Firefox上,我只看到控制台click,但是从Facebook事件中没有得到响应,完全没有错误.
When testing it on Chrome, Edge, Explorer, etc.. The console is printing properly, however, on Firefox, I just see the console click but never the response from the Facebook event, also, I'm getting no errors at all.
我不知道会发生什么,但这在Firefox上不起作用.
I don't know what may be happening, but this just doesn't work on Firefox.
如果我调用FB.login(),则会显示弹出窗口,但是在取消或确认登录后,视图只会变成白色,而永远不会关闭或返回承诺.
If I call FB.login() the popup shows up, but on cancel or confirm the login, the view just turns white and never closes or return the promise.
我试图在Firefox私有模式下运行它,现在我可以看到此错误:
I tried to run it on Firefox Private mode and now I can see this error:
" connect.facebook/en_US/sdk.js "已被阻止,因为启用了跟踪保护.
The feature at "connect.facebook/en_US/sdk.js" has been blocked because tracing protection is enabled.
仍然不知道如何解决此问题.
Put still don't know how to solve this issue.
推荐答案这是Firefox独有的功能.您可以在此处找到有关如何在私有模式下禁用此功能的信息:
This is a feature that is unique to Firefox. You can find information on how to disable this feature in private mode here:
blog.mozilla/futurereleases/2015/09/23/help-test-private-browsing-with-tracking-protection-in-firefox-beta/
您还可以在此处阅读有关Firefox跟踪保护及其如何破坏网站的更多信息:
You can also read up more on Firefox tracking protection and how it can break websites here:
developer.mozilla/zh-CN/Firefox /Privacy/Tracking_Protection
更多推荐
Facebook登录仅在Firefox上不起作用
发布评论