這是我的Facebook應用程序的當前登錄流程(有關說明,請參閱this answer)。 logout()
和login()
是呈現在用戶註銷或登錄頁面的虛擬功能。Facebook應用程序 - 無聲的「協議必須匹配」錯誤
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://
協議轉讓,但我真的不明白,爲什麼或什麼意思。爲什麼會發生這種錯誤,是否值得關注?