gpt4 book ai didi

Facebook 应用程序 - 静默 "Protocols must match"错误

转载 作者:可可西里 更新时间:2023-11-01 15:21:07 27 4
gpt4 key购买 nike

这是我当前的 Facebook 应用程序登录流程(有关解释,请参阅 this answer)。 logout()login() 是在用户注销或登录时呈现页面的虚拟函数。

window.fbAsyncInit = function() { 
FB.init({
appId: '...',
channelUrl: window.location.protocol + '//' + window.location.host + '/channel.html',
status: false,
cookie: true,
xfbml: false,
oauth: true
});

FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
login(response);
} else {
FB.Event.subscribe('auth.login', function(response) {
login(response);
});
logout();
}
});
};

使用此登录流程,我不必在用户登录时重新加载页面,但会收到静默错误:

Blocked a frame with origin "http://www.facebook.com" from accessing a frame with origin "https://s-static.ak.facebook.com". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.

我假设重新加载页面会将保存应用程序的 iframe 传输到 https:// 协议(protocol),但我真的不明白为什么或这意味着什么。为什么会出现此错误,是否需要关注?

最佳答案

这是大多数浏览器的安全问题。你不能从 http 页面 ajax 一个 https 链接

Facebook gives "Unsafe JavaScript attempt to access frame with URL" error in Chrome 可能重复

关于Facebook 应用程序 - 静默 "Protocols must match"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17539993/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com