There isn't a way of protecting against this attack, unless these buttons can't be embedded in web pages.
Well, that, or use Flash.
Well, that, or use Flash.
Also because of this example I went one step further and used AdBlock to block any iframe with a facebook url.
@general The facebook button (at least in firefox) doesn't change to the hand icon when hovering over the link. So, fail. I wouldn't click a link where the cursor didn't change. Mostly, because when it doesn't change I immediately become suspicious.
com##IFRAME[src^="http://www.facebook.com/]
##IFRAME[src*="facebook.com"]
edit: Note - you need the 'Element Hiding Helper' that goes with Adblock Plus to do this. Then you can just use that to select the iframe on a site and add the rule through a nicer interface.