TL; DR
set FB._https to true before calling FB.init . For example:
FB._https = true; FB.init({ });
Explanation
If you split the SDK for Facebook, you will see that it is basically an object literal with a bunch of properties. One of these properties is _https , which is Boolean. This property determines which set of URLs to use (stored in FB._domain ) when executing API requests. Facebook seems to support two sets of URLs for each type of API request — a secure URL and an insecure URL, and then uses a toggle function called getDomain() to determine what to use when making requests.
The reason the JavaScript SDK triggers security warnings is due to the way the FB._https property is FB._https . Here is how it is currently determined as of 2011-8-24:
_https: (window.name.indexOf('_fb_https') > -1)
Facebook seems to think that if the window.name property has _fb_https , then this should be a safe application. This is obviously not true. A real test should look something like this:
_https: window.location.protocol == "https:"
Unfortunately, the SDK is not open source or even well documented, so I cannot send a transfer request for this change: P. In the short term, the installation FB._https to true manually before calling FB.init should do the trick.
Ralph Holzmann Aug 24 '11 at 20:36 2011-08-24 20:36
source share