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

50 comments:

  1. 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. Any advice for Safari users? Thanks!

    ReplyDelete
  3. Thanks for that, works nicely for Chrome with that adjustment.

    ReplyDelete
  4. 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. Another thanks to you--this works well.

    ReplyDelete
  6. 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. Wladimir's the current guy maintaining AdBlock Plus, so, yup, he'd be right. ;-)

    ReplyDelete
  8. I used your chrome addition, thanks so much!

    ReplyDelete
  9. Thanks so much for this!

    ReplyDelete
  10. 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
  11. I love you. No more do I see that shitty like button!

    ReplyDelete
  12. worked like a charm. thanks for the help =]

    ReplyDelete
  13. Also, if you simply logout of your FB, you won't show up.

    ReplyDelete
  14. 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
  15. thanks for helping in the quest of privacy !!!

    ReplyDelete
  16. 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
  17. 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
  18. 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
    Replies

    1. Stopped liking firefox when they started creating new versions every week. Tested chrome and found it didn't do what I wanted. Opera just felt weird. Safari gives me the features I like and the security and stability that firefox used to give me.

      Safari is a good browser, just not many people use it since it is no longer maintained in windows. But since I have a mac Im good.

      Delete
  19. 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
  20. Thank you, this is awesome.

    ReplyDelete
  21. 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
  22. 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
  23. Where is the LIKE button for this? ;-)

    ReplyDelete
  24. 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
  25. 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
  26. thank you thank you thank you!!!!

    ReplyDelete
  27. THANK YOU SO MUCH.

    ReplyDelete
  28. How can one do this for Opera?

    ReplyDelete
  29. 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
  30. 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
  31. 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
  32. 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
  33. Seen other "solutions" posted. Your's actually works!!!

    ReplyDelete
  34. 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
  35. 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
  36. 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
  37. Thanks so much! I was going crazy because everyone else acts like fb's opt-out actually gets rid of everything.

    ReplyDelete
  38. 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
  39. I hate visiting webpages then having to check my Facebook profile to check i didn't accidentally push the like button, thank you

    ReplyDelete
  40. I shouldn't have to install something to keep them from doing things they shouldn't be doing in the first place...

    ReplyDelete
  41. 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
  42. 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
  43. Does this block the Facebook API from loading, or does it simply block the display of Facebook integration?

    ReplyDelete
  44. Well it works but the ones that annoy me most are the ones that as soon as you click comment it shows you logged in. It worked on those but I couldnt see any of the comments at all. Is there a way to view the comments but block them from logging you in?

    The site was http://techcrunch.com/2012/07/27/chinese-case-maker-reveals-potential-iphone-5-design/

    ReplyDelete
  45. A website called battlecam.com "connected" my facebook account to my account on their site because I accidentally clicked "connect facebook" near the top right a year after I made the account and there is no way to unconnect it via there site, I blocked their app on facebook but my account is still connected. Is there anyway to fix this besides deleting my facebook? I contacted the site but they are no help. I have been on their site a long time and don't want to make another account. I installed adblock and did what you said too, but its still connected, how do i un- connect it?

    ReplyDelete
  46. Thanks a lot . Whenever i go to thinkdigit.com it stuck at connect.facebook.com , after i add the filter it stuck at platform.twitter.com then i added the filter for twitter.com it works now. is it clicking on the like page shown in website will cause this issue ??..

    I have another issue booksnreview.com is stuck at waiting for the image from booksnreview.com. I have two laptops connected in sam router. one laptop loads without any problem but the other is stuck at "waiting for images from booknreview.com". Any help is appreciated. Thanks.

    ReplyDelete