简体   繁体   English

FB.login弹出窗口不再适用于Safari Mac?

[英]FB.login popup no longer working on Safari mac?

Anyone else no longer getting popups in Safari? 还有其他人不再在Safari中弹出窗口了吗?

Here's some sample code that does not work in Safari. 这是一些在Safari中不起作用的示例代码。 It is launched by a click on link so the popup blocker shouldn't block it. 它是通过单击链接启动的,因此弹出窗口阻止程序不应阻止它。 Any ideas why it does? 任何想法为什么会这样?

Online example here: 此处的在线示例:

http://users.telenet.be/prullen/fbtest.html http://users.telenet.be/prullen/fbtest.html

Note that this will not run through the expected behavior since it's on another domain and has an incorrect app ID. 请注意,由于它在另一个域上并且具有不正确的应用程序ID,因此不会通过预期的行为运行。 But the only thing that matters for this example is the showing of the popup. 但是,此示例唯一重要的是弹出窗口的显示。

<script type="text/javascript">
var fbLoaded = false;
var doReLogin = true;

function createAccessToken(){   
if (!fbLoaded) {
    FB.init({
    appId      : 'xxx', // App ID
    status     : true, // check login status
    cookie     : true, // enable cookies to allow the server to access the session
    xfbml      : true  // parse XFBML
    });
}

fbLoaded = true;

FB.getLoginStatus(function(response) {      
    if (response.status === 'connected') {
        getExtendedAccessToken(response.authResponse);
    } else {
        FB.login(function(response) {
            if (response.status == 'connected') {
                if (response.authResponse && response.authResponse.accessToken) {
                    getExtendedAccessToken(response.authResponse);
                } else {
                    alert('You cancelled login or did not fully authorize.');
                }
            } else {
                alert('To use you have to create an access token.');
            }
        }, {scope: 'read_stream'});
    }
 }, true);
}

function getExtendedAccessToken() {
}
</script>

<p style="text-align:center;"><a href="#" onclick="createAccessToken();return false;" class="connect">Connect With FaceBook</a></p>

Can you check your settings regarding blocking pop-up window? 您可以检查有关阻止弹出窗口的设置吗? This issue: Facebook Login not open in Safari/ iPhone the same as you have, I guess. 这个问题:我猜想在Safari / iPhone中无法打开Facebook登录名

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM