Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox blocking Facebook Js

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?

like image 954
Peter Avatar asked Nov 22 '15 14:11

Peter


People also ask

How do I enable Javascript on Facebook?

Once the page is loading, mouse to the address bar and '''Left''' click the icon. Select '''Permissions. ''' In the menu, Make sure the ones you want to use are set to '''Ask''' or '''Allow. '''

How do I block a website without addons in Firefox?

Select the three dots next to Block Site. Click on Options. Firefox will open a new page for you. Find the Block a new hostname box and enter the name of the website you want to block.

How can I restrict websites in Firefox?

If you're on Android you can add a free extension called Leechblock NG to your mobile browser. It works much the same as Site Blocker above. Toggle on the option that says “Content & Privacy Restrictions” and press the “Content Restrictions” heading below.


2 Answers

A simple google search leads to this page: https://developer.mozilla.org/en-US/Firefox/Privacy/Tracking_Protection

You should be able to deactivate that feature right where the message appears, or via about:config. It should actually be deactivated by default afaik.

like image 71
andyrandy Avatar answered Oct 02 '22 12:10

andyrandy


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

like image 24
bodzin Avatar answered Oct 02 '22 13:10

bodzin