hans.gerwitz

Keep Digging

Posted on April 11th, 2009

John Gruber has called attention to Digg’s shameful revival of site framing, and I share his disgust. Though I’ve no expec­tation of Digg traffic to my little blog, on prin­ciple I feel compelled to partic­ipate and block the DiggBarr from obscuring my URLs.

Phil Nelson and Shawn Medero’s DiggBarred handles this nicely for WordPress, using server scripting to present a different page to browsers loading into a DiggBar frame. But to be polite to my little server slice, I like to use WP Super Cache in “full on” mode, which precludes consistent per-​​request processing by plugins.

I could use Apache mod_​rewrite rules to similar affect, but that’s another layer of config­u­ration I want to avoid and is, like PHP solu­tions, Digg-​​specific.

So I’d like to use client scripting. Faruk Ateş has offered DiggBar killer JavaScript, which is still Digg-​​specific and too nice.

Perhaps we should refine the typical frame-​​busting approach (detect when the page is framed and reload the window directly to the page) and take a frame-​​embracing stance (reload the page with their frame):

<script>
if (top !== self) {
  self.location.replace(document.referrer);
}
</script>

I’ve put that code here for testing, which can be seen by viewing this post’s Digg URL: http://digg.com/u1mst.

View Comments to “Keep Digging”

  1. Thomas M Says:
    Actually, when I click the Digg URL to this post I get a window that constantly reloads adding another DiggBar to the top each time in a never-​​ending loop.

Leave a Reply

blog comments powered by Disqus