Thursday, May 20, 2010

Disabling Facebook Connect on Non-Facebook Websites

** Updated 7/19 - improved code after re-reading the ABPlus guide thanks to a user comment from Mr. Palant - also added Chrome code from reader tips**


Important, if you find a site where this does not work please include the URL in a comment below - as sites get tricky the code may need to be adapted or new blocks created

For reasons I won't get into in this post I'm very discouraged by the recent Facebook Connect changes that have, without my approval, spread my Facebook persona across various websites that personally I don't want integrated with Facebook. Some examples are the Gawker Media Sites, techcrunch or money.cnn.com - I've recently started seeing little things like this all over sites: 

As seen from money.cnn.com

Here is how to disable Facebook Connect completely


Because of a lack of opt-out available, I've been forced to use an Ad Blocker to disable this functionality completely. I've tested this for a while and after a number of tweaks I finally found a solution that does not break any on Facebook functionality while stopping Facebook Connect.

1. Get Firefox  - also reported to work with Chrome and Opera (see below) (if you still use IE sorry, can't help you there).


2. Install AdBlock Plus for Firefox - here. Click the Install Adblock Plus 1.2 link (1.2 may change). This will present you with a Yellow Security bar near the URL bar at the top of your screen: 
click Allow
You will then be prompted to install the add-on after a short countdown

click Install Now

After Install you will be asked to restart Firefox for the install to complete
click Restart Firefox

 Once Complete and Firefox restarts you will have a new ABP icon in next to the search box as well as a new AdBlock menu item under Tools > AdBlock Plus Preferences - access the preferences via the button or menu item 


3. Add the following "Facebook Block" Filter Click the Add filter... button - in the text field that appears copy and paste the following line:

||facebook.*$domain=~facebook.com|~127.0.0.1


I've received some emails asking for an explanation of the block code - so here it is ||facebook.* is to block anything from Facebook's domains. $domain=~facebook.com|~127.0.0.1 is an exclusion to the block that states if you are actually on facebook.com don't block the content. The 127.0.0.1 exclusion is your local computer - this is because the Facebook plugin used by the Java picture uploader actually loads from your local computer, this makes sure the uploader continues to work.

4. Click Apply - OK


That's it - you now have blocked Facebook Connect (no more like or share buttons and no more auto-logged into website X using your Facebook cached credentials) - you can test it by visiting any article on money.cnn.com (not the main page but an article) and you should see zero Facebook integration. If you come across any pages that this didn't work - let me me know in a comment below so I can "expand" the guide to make sure that site is blocked too.

Chrome Instructions:
Per user tips (not tested myself) the same can be done for Chrome Browsers using the Ad Block Plus plugin for that browser with only a small change to the code:

*.facebook.*$domain=~facebook.com|~127.0.0.1

(missing the pipe charaters ||)

Opera Instructions:
Again per user tips (not tested myself) - Opera has built in blocks without the need for Ad Block Plus.
Settings > Preferences > Advanced > Content > Blocked Content then select add and put *.facebook.*$domain=~facebook.com|~127.0.0.1 into the field

45 comments:

  1. AnonymousJul 12, 2010 05:14 AM
    Hi just wanted to share that if you install Adblock plus for Chrome, got to blacklist and add the line mentioned in the post but dont use the ||

    Using pipes will render the filter invalid.

    Cheers and many thanks for this :)
    ReplyDelete
  2. AnonymousJul 14, 2010 06:41 AM
    Any advice for Safari users? Thanks!
    ReplyDelete
  3. AnonymousJul 14, 2010 07:54 AM
    Thanks for that, works nicely for Chrome with that adjustment.
    ReplyDelete
  4. AnonymousJul 14, 2010 10:02 AM
    Is it really that hard to just logout of facebook?

    Those annoying facebook post boxes everywhere just serve as a reminder that you should logout of facebook, which is good practice anyway.
    ReplyDelete
  5. AnonymousJul 15, 2010 06:16 AM
    Another thanks to you--this works well.
    ReplyDelete
  6. AnonymousJul 15, 2010 07:03 AM
    On teefury.com, the block removed the "like" facebook button, but the "connect" one is still there. It's deactivated, but I still have to look at it. I hate facebook.
    ReplyDelete
  7. AnonymousJul 15, 2010 08:57 AM
    Thank you!
    ReplyDelete
  8. AnonymousJul 25, 2010 02:05 PM
    Wladimir's the current guy maintaining AdBlock Plus, so, yup, he'd be right. ;-)
    ReplyDelete
  9. AnonymousAug 5, 2010 07:44 AM
    I used your chrome addition, thanks so much!
    ReplyDelete
  10. AnonymousAug 5, 2010 05:20 PM
    Thanks so much for this!
    ReplyDelete
  11. AnonymousAug 9, 2010 03:21 AM
    Thank you for the code blocking facebook, but after further testing, it only hides it. Facebook still connects to those sites that utilize facebook connect and they can still log my facebook id.
    ReplyDelete
  12. AnonymousSep 3, 2010 07:14 PM
    I love you. No more do I see that shitty like button!
    ReplyDelete
  13. AnonymousSep 6, 2010 10:36 AM
    worked like a charm. thanks for the help =]
    ReplyDelete
  14. AnonymousSep 22, 2010 10:31 AM
    Also, if you simply logout of your FB, you won't show up.
    ReplyDelete
  15. AnonymousSep 30, 2010 12:45 PM
    i'm from germany and today was the first time i personally came across facebook connect.. i don't use facebook a lot and maybe the reason why i've not seen facebook connect before is that i use few english and american pages and applications. it was at the german video portal myvideo.de where curiously i seemed to be logged in with my real name. first thing i thought was: uh did i create an account on that page using my facebook pic (i've not changed it in a while) and forgot about it??.. then i came to realize that this page was connecting me to facebook which i completely disliked since i post stuff and comments on video sides that i don't want to be directly connected with my real name on facebook; and be it just cause i don't want everyone to know what i do.. i thought there had to be a way of disabling this gross abuse of privacy and when i came to realize there is none on the page itself i was thinking about deleting my facebook account... searching on google at first gave me the impression that it's become normal to expose oneself through facebook connect in a way that equals putting a livecam in my bathroom that films me while taking a shit...
    to sum it up, i added your filter (had ABP on firefox already) and was glad that there seem to be people who don't want to tell everyone around the world that they've just farted... very happy with that block!!
    ReplyDelete
  16. AnonymousSep 30, 2010 12:56 PM
    thanks for helping in the quest of privacy !!!
    ReplyDelete
  17. AnonymousOct 25, 2010 08:27 PM
    I'm on firefox. Added the code to my adblock plus. Went to the "People.com" celebrity magazine website. It's still there...my facebook profile asking me to comment on a dumb article.
    ReplyDelete
  18. AnonymousOct 25, 2010 08:35 PM
    Nevermind. I thought I had hit the "OK" button after pasting in the code, but I hadn't. The code works. I thank you most sincerely.
    ReplyDelete
  19. AnonymousNov 4, 2010 02:25 PM
    safari users can do this by uninstalling safari and installing firefox. If you have not done this yet you should have a long long time ago. This will fix most of your issues.
    ReplyDelete
  20. AnonymousNov 18, 2010 11:19 AM
    This is also helpful for me at work where facebook is blocked. When I click a link that tries to use Facebook Connect, it takes forever to load the new page while the browser figures out that facebook is blocked. Following this advice has removed that annoyance. Thank you very much.
    ReplyDelete
  21. AnonymousNov 22, 2010 08:50 AM
    Thank you, this is awesome.
    ReplyDelete
  22. AnonymousNov 30, 2010 09:46 PM
    There is an Adblock extension for Safari, just go to http://safariadblock.com/. Once installed, it will give you a new "Adblock Options" button. If you click on this and go to "Blacklist" and then click on the "Edit" button, you can add the filter.

    I think the leading pipes will not work. It works without them:

    facebook.*$domain=~facebook.com|~127.0.0.1
    ReplyDelete
  23. AnonymousDec 10, 2010 05:08 AM
    There's a full adblock filter list for this purpose:

    http://www.fixmbr.de/socialmediablock-filterliste-fuer-adblock-plus/ (in German)


    abp://subscribe/?location=http://monzta.maltekraus.de/adblock_social.txt&title=SocialMediaBlock
    ReplyDelete
  24. AnonymousJan 10, 2011 09:32 AM
    Where is the LIKE button for this? ;-)
    ReplyDelete
  25. AnonymousJan 23, 2011 01:46 PM
    I don't understand your dislike of the feature, the websites can't see your fb info, they can't see who you are and they can't interact with your account.

    FB Connect uses an iFrame, this means everything is segregated by the browser as it would be a violation of cross domain security.

    In other words sitexyz.com and facebook.com are separate domains and are not allowed to communicate with each other.
    ReplyDelete
  26. AnonymousFeb 13, 2011 02:44 AM
    I would like to completely remove anything that reminds me of facebook from my browsing experience.

    No fb icons. No fb like it.

    I do not want to live in a world where people use fb.

    Anything people get too much fanatized about is dangerous for society. And intellect.
    ReplyDelete
  27. AnonymousFeb 28, 2011 06:56 AM
    thank you thank you thank you!!!!
    ReplyDelete
  28. AnonymousMar 2, 2011 05:27 AM
    THANK YOU SO MUCH.
    ReplyDelete
  29. AnonymousMar 8, 2011 02:54 AM
    How can one do this for Opera?
    ReplyDelete
  30. AnonymousMar 11, 2011 05:56 PM
    TYVM !
    ReplyDelete
  31. AnonymousMar 16, 2011 06:22 PM
    GO into settings>preferences>advanced>content>blocked content
    then select add and put

    *.facebook.*$domain=~facebook.com|~127.0.0.1

    into the field.
    ReplyDelete
  32. AnonymousApr 3, 2011 10:34 AM
    Apart from the standard web page moved or similar domain brand protection redirects. I think it's simply wrong and getting rediculous the number of connections to domains I haven't requested, if I look at a url and decide I trust that url I shouldn't be connected to a hundred others. It's more than rude, maybe I can twist this example to create a generic to browser/system firewall with override which allows my chosen actions. The only forseeable problems if its doable are sites refusing to play ball.
    ReplyDelete
  33. AnonymousApr 13, 2011 04:45 PM
    Why do I see FB content when I go to latimes.com?? WHY...!! I AM NOT GOING TO FACEBOOK. WHY DO I HAVE TO CARE ABOUT FB IF I AM GOING TO LATIMES.com

    Perhaps my bank account information should be there too. ready to open my wallet just in case I want to buy something.

    WE DONT LIKE IT.
    ReplyDelete
  34. AnonymousApr 18, 2011 08:17 PM
    Thank you for this! I hate that you can't just opt out. I actually considered *gasp* deleting my Facebook account if this got much more invasive.
    ReplyDelete
  35. AnonymousApr 20, 2011 08:32 AM
    Seen other "solutions" posted. Your's actually works!!!
    ReplyDelete
  36. AnonymousApr 24, 2011 07:55 PM
    thank you very much for this guide... this really helps a lot because of our limited internet usage at work wherein almost all sites which has a facebook-related button are blocked.

    thanks again!!!
    ReplyDelete
  37. AnonymousApr 29, 2011 05:22 PM
    Thanks for this! Yesterday I was reading a rather politically incorrect article and it was somehow posted to my facebook page as a like! Unfortunately, that took a bit of explaining, but glad that won't be happening again. Thanks for the info :)
    ReplyDelete
  38. AnonymousMay 13, 2011 08:12 PM
    thanks but I just wanted to state that yes this will block the facebook object from appearing but it wont disable to internal integration to the facebook API
    ReplyDelete
  39. AnonymousMay 17, 2011 04:23 PM
    Thanks so much! I was going crazy because everyone else acts like fb's opt-out actually gets rid of everything.
    ReplyDelete
  40. AnonymousMay 19, 2011 11:42 AM
    I just used the Chrome block, and from what I can tell, washingtonpost.com (the only website I've checked so far) doesn't think I'm logged in with FB. It gives me the option to connect with FB, Twitter, etc, but doesn't know that I'm already logged in to FB.

    I do have one question, though... this only blocks it for me, right? My other friends will still be able to see my name on those same websites if, for example, I shared an article from the website, etc?

    Darn FB... I'm getting really ornery about them.
    ReplyDelete
  41. AnonymousJun 2, 2011 05:03 AM
    I hate visiting webpages then having to check my Facebook profile to check i didn't accidentally push the like button, thank you
    ReplyDelete
  42. AnonymousJun 14, 2011 09:36 AM
    I shouldn't have to install something to keep them from doing things they shouldn't be doing in the first place...
    ReplyDelete
  43. AnonymousJun 16, 2011 08:32 AM
    First of all I am very grateful for this. Strange thing is that after installing the extra filter in Adblock, on money.cnn.com the Facebook integration is still present. While on other sites like www.thehuffingtonpost.com FB icons are still there but no longer redirect me to Facebook (also fine for me). Luckily on most sites, like the Ducth ones I use (I'm from the Netherlands) Facebook Connect is completely gone. So much obliged and just telling you about money.cnn.com.
    ReplyDelete
  44. Bill ChampNov 6, 2011 10:27 AM
    Safari users: This trick works on Safari 5.1.1 (I'm running 10.6.8) if you install the AdBlock extension. The filter string works as is with no modification necessary. The AdBlock extension is currently listed as the most popular extension on Apple's website listing of Safari extensions. It is also available at the developer's website: http://safariadblock.com/
    ReplyDelete
  45. KateNov 21, 2011 07:00 PM
    Many thanks!
    ReplyDelete