当我尝试使用Twitter时间线,或在Firefox中的任何网站上查看推特时间线时,我都会收到控制台警告:
The resource at "https://platform.twitter.com/widgets.js" was blocked because tracking protection is enabled.
Run Code Online (Sandbox Code Playgroud)
我对这个问题有三个部分:
最令人气愤的:
以下是一些被阻止的时间表示例:
http://www.success-equation.com/home.html
http://userapp-io.github.io/twitter-timeline-angularjs/demo/demo.html
http://entrepreneurship101.mit.edu/(以页脚)
http://minitwitter.webdevdesigner.com/
以下是一个有效的示例(仅限于twitter.com域) https://blog.twitter.com/2014/3-power-tips-for-using-embedded-timelines
以下是对SO的跟踪保护的说明:https://stackoverflow.com/a/34243073/3700836
Firefox 42.0 - Mac OSX 10.10,也可在Windows 10上看到
一个有趣但令人沮丧的脚注:不要打扰推特到Twitter @support,他们不回应推文.
我使用以下代码在我的项目中加载facebook js sdk异步:
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.net/de_DE/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
Run Code Online (Sandbox Code Playgroud)
自firefox跟踪保护以来,这对我来说很好.我注意到在firefox 42.0中跟踪保护阻止了facebook js sdk的异步加载.
但它似乎只是被阻止,当我没有登录Facebook.
有没有人知道如何解决这个问题? …
随着Firefox升级到42.0我有一些奇怪的行为..
我正在调用这样的FB.init方法:
FB.init({
appId: '{$appid}',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
Run Code Online (Sandbox Code Playgroud)
但在Firefox中它被阻止,我收到警告:
" https://connect.facebook.net/en_US/all.js "上的资源被阻止,因为启用了跟踪保护.
这是默认行为,我没有设置任何额外的安全性或其他什么..
该怎么办?
编辑 - 在帮助和谷歌搜索后,这是一个更大的问题:
结果证明Firefox的Do Not Track和跟踪保护是两回事:
不跟踪在偏好设置中启用/选项>隐私>"告诉我不希望被追踪的网站".启用发送DNT标头但不阻止任何请求.
在about:config> privacy.trackingprotection.enabled中启用了跟踪保护.启用不会发送DNT标头,但会根据Disconnect的阻止列表阻止请求.因此检测2并不像检查navigator.doNotTrack那么容易,因为该属性仅设置为1.
解决方案(暂时) - 尝试做FB.init,如果错误做了一些警告..
try {
FB.init({
appId: '{$appid}',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
}catch(err) {
alert('Some info for the user...');
}
Run Code Online (Sandbox Code Playgroud)
有人有更好的解决方案吗?