Facebook JavaScript SDK over HTTPS loading non-secure items

前端 未结 8 1583
时光说笑
时光说笑 2020-11-29 21:19

I have a Facebook application that uses the Facebook Connect.js.

I am running my application over HTTPS. All content on the site is delivered from https://

8条回答
  •  清歌不尽
    2020-11-29 21:57

    Adding to Ralph Holzmann and Simon Bächler, the following is an even harder-hitting fix for when FB._https alone does not do the trick;

    FB._https = (window.location.protocol == "https:");
    FB.init({
        ...
    });
    if (FB._https && window == window.parent) {
        if (FB._domain && FB._domain.staticfb && FB._domain.https_staticfb)
            FB._domain.staticfb = FB._domain.https_staticfb;
    }
    

    See also FB.Arbiter.inform() { ... FB.getDomain((d?'https_':'')+'staticfb',true) ... } where d=window!=window.parent&&... as of 2012-Feb-10.

提交回复
热议问题