Facebook登录仅在Firefox上不起作用 [英] Facebook login doesn't work on Firefox only

查看:109
本文介绍了Facebook登录仅在Firefox上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在网站上使用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.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,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:

" http://connect.facebook.net/en_US/sdk.js "已被阻止,因为启用了跟踪保护.

The feature at "http://connect.facebook.net/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:

您还可以在此处阅读有关Firefox跟踪保护及其如何破坏网站的更多信息:

You can also read up more on Firefox tracking protection and how it can break websites here:

https://developer.mozilla.org/zh-CN/Firefox /Privacy/Tracking_Protection

这篇关于Facebook登录仅在Firefox上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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