Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
87
rated 0 times [  93] [ 6]  / answers: 1 / hits: 15853  / 9 Years ago, sun, november 22, 2015, 12:00:00

with upgrade of Firefox to 42.0 I got some strange behavior..



I'm calling FB.init method like this:



FB.init({ 
appId: '{$appid}',
status: true,
cookie: true,
xfbml: true,
oauth: true
});


But in Firefox it gets blocked, I get warning:



The resource at https://connect.facebook.net/en_US/all.js was blocked because tracking protection is enabled.



This is default behavior, I didn't set up any additional security or whatever..



What to do?



EDIT - after help and googling, this is a little bigger problem:



Turns out Firefox's Do Not Track and tracking protection are two separate things:



Do Not Track is enabled in Preferences/Options > Privacy > Tell sites that I do not want to be tracked. Enabling sends the DNT header but it does not block any requests.



Tracking Protection is enabled in about:config > privacy.trackingprotection.enabled. Enabling does not send the DNT header, but does block requests based on Disconnect's blocklist. So detecting 2 isn't as easy as checking navigator.doNotTrack, because that property is only set for 1.



Solution (temporarily) - try to do FB.init, if error do some alert..



try {
FB.init({
appId: '{$appid}',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
}catch(err) {
alert('Some info for the user...');
}


Does anyone have better solution?


More From » facebook

 Answers
25

From the client side, you can't. This is security policy Firefox. You can read about this issue in thread: https://bugzilla.mozilla.org/show_bug.cgi?id=1226498


[#64309] Thursday, November 19, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
janjadonb

Total Points: 4
Total Questions: 114
Total Answers: 118

Location: Mali
Member since Fri, Dec 3, 2021
3 Years ago
;