Killing the DiggBar

Publié le :

Last week Digg released the DiggBar, and it's like it's web 0.1 from 96 again.

In Digg's own words:

“The DiggBar enables you to Digg, read comments, find related content, and share stuff from any page on the Web. And it’s presented in a short URL format, making it easy to share in emails, on Twitter, and via other services. In addition to finding it on all outbound links from Digg, you can generate the DiggBar using any of the following solutions.”

Translated from corporate speech by 3 Dog Media in Just Say No to Digg's DiggBar, this gives:

“The DiggBar is an incredibly clever framejacking tool disguised as a URL shortening service. The mass adoption of the DiggBar by the thousands of users who constantly distribute un-digg-worthy content through our most feared competitor, will allow us to generate millions of additional revenue dollars by injecting our ads in between our feared competitor and the destination url.”

There are a lot of interesting things to dig in Greg's post at 3 Dog Media, notably things that smell like flat-out lies from Digg, but the bottom line is that it's a terrible thing that site owners at large must get rid of:

Think about it for a moment. You invest countless hours promoting your content. You get lucky enough to make the homepage of Digg, or you hit the Retweet motherload on Twitter. A certain percentage of all those people who see your content are going to copy & paste the link they land on into a blog post. (Thereby generating a link for your site).

Before the DiggBar, (and with legit shortening services) all those links would point to your url. Now, a large percentage of them are going to be links pointing to a page on Digg. Now if you are Yahoo, CNN, or the BBC, that isn’t really going to matter much. You don’t have to spend time thinking about building link equity, because you already have it. However, if you are a newer site struggling to build trusted link equity in the current black hole environment we live in, the mass adoption of the DiggBar is a serious issue.

I will be advising all clients to add some frame busting code to their sites so the DiggBar won’t work for the simple reason that regarless which scenario is accurate, they are both equally wrong.

Hopefully, others will do the same.

I'll do the same. Because what Digg does is the same bullshit we've endured ten years ago with framebusting, as John Gruber points out:

All sorts of sites tried this sort of trickery back in the mid-’90s when Netscape Navigator 2.0 added support for the <frameset> tag. It did not take long for a broad consensus to develop that framing someone else’s site was wrong. URLs are the building block of the Web. They tell the user where they are. They give you something to bookmark to go back or to share with others.

The DiggBar breaks that, and I’ve seen no argument that makes it any more sense to support this than it does to support 1996-style <frameset> site embedding.

Or in other words:

Framing breaks bookmarking, it breaks copy-and-paste from the location field, it breaks your browser history, it breaks bookmarklets. There’s nothing OK about it.

Here's what you can do to block the DiggBar on your own sites:

In javascript within your pages, use a framebuster or frame killer like Faruk Ateş's JavaScript DiggBar killer. This will simply reload your page without the frame, and this is as simple as adding this line to any Javascript file you have:
if (top !== self && document.referrer.match(/digg\.com\/\w{1,8}/)) {

In PHP, use John Gruber's DiggBar blocker:
if (preg_match('#\w{1,8}/*(\?.*)?$#', $_SERVER['HTTP_REFERER']) ) {
    echo "<p>Special message for Digg users here.</p>";

Warning, John's code will just show a message framed within the DiggBar and stop serving the page, it won't redirect users. I find it a bit hard on innocent users, when it's Digg the culprit. You can see it in action here.

For Movable Type users, I would advise to use either the frame killer JS (for static pages) or John Grubers's method (for PHP pages).

For Wordpress, use Phil Nelson's Diggbarred plugin.

For Expression Engine, use Derek Jones's DiggBar Blocker plugin.

For Drupal, use the DiggBar Blocker by Henrik Sjökvist.

In Ruby on Rails, use Ben Sandofsky's ActsAgainstDoucheBar plugin.
There's also rack-dickbarblocker, a Rack middleware that displays a special page to anyone using the DiggBar, by Markus Prinz.

In Django, use Matt George's diggtoolbar Django plugin.

If you're a Digg user, you can disable the DiggBar under
My Profile → Settings → Viewing Preferences.

And if you're using Firefox with Greasemonkey, you'll enjoy Shaun Grady's DiggBar Killer script which will get rid of that annoyance for good in your browsing experience.