admin管理员组文章数量:1435859
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!
Share Improve this question asked Nov 19, 2015 at 16:22 mmommo 1539 bronze badges 3- It's 2016 and still no answer? :O For now, I just asked my QA Engineer to turn off tracking protection :D – Muhammad Mobeen Qureshi Commented Feb 8, 2016 at 11:09
- Yep, It seems that the only way is to disable it... – see Commented Apr 8, 2016 at 9:34
- Are you sure it's only Asynchronously loaded scripts, and not external scripts period? – StackSlave Commented May 10, 2016 at 22:58
1 Answer
Reset to default 6Tracking 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.
本文标签: javascriptfirefox tracking protection blocks async load of facebook js sdkStack Overflow
版权声明:本文标题:javascript - firefox tracking protection blocks async load of facebook js sdk - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745653457a2668567.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论