I am loading the facebook js sdk asynchronous in my project with the following code:
window.fbAsyncInit = function () {
FB.init({
appId: settings.facebookAppId,
cookie: true, // enable cookies to allow the server to access the session
xfbml: true, // parse social plugins on this page
version: 'v2.0' // use version 2.0
});
FB.Canvas.setAutoGrow();
};
// Load the SDK asynchronously
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook/de_DE/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
this worked fine for me since firefox tracking protection. i noticed that in firefox 42.0 the tracking protection blocks the asynchronous load of the facebook js sdk.
but it seems to be only blocked, when i am not logged in on facebook.
does anyone has an idea how to solve this problem?
many thanks!
I am loading the facebook js sdk asynchronous in my project with the following code:
window.fbAsyncInit = function () {
FB.init({
appId: settings.facebookAppId,
cookie: true, // enable cookies to allow the server to access the session
xfbml: true, // parse social plugins on this page
version: 'v2.0' // use version 2.0
});
FB.Canvas.setAutoGrow();
};
// Load the SDK asynchronously
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook/de_DE/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
this worked fine for me since firefox tracking protection. i noticed that in firefox 42.0 the tracking protection blocks the asynchronous load of the facebook js sdk.
but it seems to be only blocked, when i am not logged in on facebook.
does anyone has an idea how to solve this problem?
many thanks!
Tracking Protection (enabled by default in Firefox 42+) blocks any resources from a pre-defined set of domains while in private browsing mode.
Starting in version 42, Firefox Desktop and Firefox for Android include built-in tracking protection. In Private Browsing windows (tabs, in Firefox for Android), Firefox will block content loaded from domains that track users across sites.
https://developer.mozilla/en-US/Firefox/Privacy/Tracking_Protection
Tracking protection currently uses disconnect.me's basic list by default.
The fact that the script is loaded asynchronously is irrelevant as its the domain that is blacklisted.
Even if you host the JavaScript file yourself, any requests to Facebook domains are also blocked.
So, the only way to allow these requests is to disable tracking protection in the browser.