Fun with Facebook ?fb_xd_fragment= [UPDATED]

Posted by admin May 26th, 2011

Like most people, I’m not a fan of big megacorps making landgrab plays for great swathes of the internet, especially when they do it in a ham fisted way which breaks honest, hard working sites.

Sure it’s the job of an adopting sites testing department to make sure the site works. But the minute external dependencies are let straight onto the page all manner of fun can break loose.

Facebook comments currently has an amazingly fun problem in it, which to be honest, I don’t fully understand, and Facebook can pay me if they want me to look at it more.

The Facebook comments Javascript seems to generate a url pattern from deep in it’s bowels which seems to surface itself to users in a way I don’t fully understand, but users are coming into sites which use Facebook comments carrying a wierdy GET parameter

?fb_xd_fragment=

This parameter is truly awesome and powerful, all bow before the power

Here’s an example of how awesome it is, here’s a Techcrunch page without it:

http://www.crunchgear.com/2008/04/22/keyboard-pants-with-built-in-mouse-nerd-alert/

And here’s a Techcrunch page with it

http://www.crunchgear.com/2008/04/22/keyboard-pants-with-built-in-mouse-nerd-alert/?fb_xd_fragment=

how cool is that, the argument triggers some kind of screwup which overtakes the page to blank it

Stupid external dependancies are stupid

We’re having a go at popping redirects in at apache level to 301 the argument back to the page, ie, to strip the argument, oh, I also set the parameter to ignore in Google Webmaster Tools.

Facebook also passes another crappy parameter, it’s a ?fb_comment_id she’s not nearly as feisty as fragment, comment should be set to ignore in WMT as well

UPDATE:
I’m seeing some people talking about using parent frame checkers and eval’ing a document.location.replace type mechanism … srsly, do not do this….

UPDATE 6th September 2011:
It looks like there’s been a code push from Facebook which means that the page takeover no longer happens. So it’s just the dupe content generated from the crawl path for the fragment and the comment


6 Responses

  1. Steve says:

    But those pages use the Disqus commenting system, not FB? TC haven’t ported FB comments to Crunchgear yet.

    But yes, add the param to a TC page and it is indeed blank: http://techcrunch.com/2011/05/25/and-the-winner-of-techcrunch-disrupt-nyc-is-getaround/?fb_xd_fragment=

  2. admin says:

    Hi Steve,

    I guess they must have the FB codelib in the template all ready to elbow Disqus

    PH3AR THE _FRAGMENT

    • Alex says:

      This post is misleading.

      See:
      http://developers.facebook.com/docs/reference/javascript/FB.init/

      Facebook iframes the page it’s on in order to create a cross domain communication channel. The get parameter it adds notifies the facebook javascript library in the iframe that it’s the child and that it should set up the channel. It also triggers the page to blank in order to reduce the render time of the page/create the channel faster. Facebook used to require developers to upload a file to their servers to act as this channel, but for some developers, this is not possible.

      If you want to avoid these issues, you can use the channel parameter to specify the cross domain file you want to use ( see “Custom Channel URL” in the above url).

  3. Ronnieboy says:

    If people are arriving at your site with ?fb_xd_fragment= in the URL, you are implementing XFBML like buttons without utilizing the channelUrl config option in the FB JS SDK:
    http://developers.facebook.com/docs/reference/javascript/FB.init/

    ChannelUrl will direct all IE XDR traffic to the endpoint you specify. Then you just cache the hell out of the endpoint with far future expires headers. Once you’ve done this, your pages won’t show up on search results pages with the ?fb_xd_fragment param on them:

    http://www.searchmarketingman.com/2010/09/how-to-fix-like-button-bug.html

Trackback URL for this entry