Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to block the DiggBar (daringfireball.net)
136 points by fromedome on April 10, 2009 | hide | past | favorite | 44 comments


  <script language="JavaScript" type="text/javascript">
  <!--
  function breakout_of_frame()
  {
    if (top.location != location) {
      top.location.href = document.location.href ;
    }
  }
  -->
  </script>
  ...
  <body onload="breakout_of_frame()">
====================

The above is from: http://www.thesitewizard.com/archive/framebreak.shtml

Another, shorter example: http://www.irt.org/script/473.htm

Actually, now that I've RTFA, it looks like the one DF linked to originally is swell, and doesn't require using onload:

http://en.wikipedia.org/wiki/Framekiller


Psst...indent your comment two spaces to display as code.


Thanks, erlanger!


It's a pity that Digg also made a grab for the URLs at the same time as they did the framing. Framing, despite all its 1996 squick factor, can be very handy: I've often wished HN had a bar similar to Reddit's, and the Google Images frame is good, too.

I don't think Gruber goes nearly far enough in explaining his objections, however: he barely bothers beyond an "of course" and appeal to consensus. He does mention that URLs are important, and assumes that people will agree. But if you don't automatically agree, that's not going to carry the argument: after all, the full URL is in the DiggBar, and can be C&Pd by anyone savvy enough to care.

Of course, the real problem is with unsavvy users who are going to start passing around URLs that flow via Digg, a blatant landgrab on their part, but he doesn't really explain this. By talking in passing about fights that we had in 1996 he's talking about ancient history to Digg's audience, and they're simply going to assume he's a cantankerous old grump, rather than realising why Digg's actions should be condemned.

The "fuck you" page doesn't help this cause either: he could have used it to explain why the seemingly-useful bar's actually a bad idea. Instead, he's just going to piss off the hordes. A wasted opportunity, I think.


You appear to have mistaken the author for someone who cares about Digg's audience. Gruber doesn't care about Digg's audience ("mindless, borderline illiterates"), and he has little incentive to educate them on why Digg's new shit salad has so much shit in it.


I understood that, but he's got an audience that he presumably does care about, and he could have both snarked at Diggers and educated the people who don't understand the fuss at the same time.

(Also, if he actually wants Digg to stop this, the best possible way is to point out to Diggers why the salad they're getting is full of shit so they can have one of their classic revolts)


I think I prefer the web 1.0 way of "manage it yourself" (tabs) as oppose to the web 2.0 way of "we'll do everything we think you want" (the digg bar).


for sites where there's commentary, i do often wish there was a side-by-side view of the site and the commentary on the site.


While I concede that the majority of Digg users are either unintelligent or insane, there are still a good portion of relatively reasonable people like myself who enjoy the service. Personally, I don't believe I'm the type of reader Gruber should be telling to "fuck himself", but that's exactly what he's doing. A far more reasonable approach would be to simply redirect to an unframed version of the page. Otherwise, why not just display this lovely page to any traffic with "digg.com" as the referrer?


Suddenly, without warning, digg has transformed themselves into IE6. The vast unwashed majority that you really don't want to have to deal with, but are forced to.


The parallel with IE6 goes further than you might have expected. The Digg folks have managed to screw up the page rendering in at least one non-IE browser.


Curious - which one?


I don't believe I'm the type of reader Gruber should be telling to "fuck himself"

Then tell Digg to disable their stupid bar. Tell them again and again.

That's obviously the idea. The difference between the Diggbar and IE6 is that Digg can solve the problem whenever they want. They can even selectively solve the problem for certain sites, though such behavior would not be very nice.


A far more reasonable approach...

Albeit, not nearly as funny :) I suppose I should be growing out of that kind of humor, thought...


Love it: http://digg.com/d1oNOZ

For some reason I like this method better than frame-busting. To make it useful you could add a link to your homepage on there.


There is a direct link to the page in the digg bar itself and when clicked, the "fuck you" message remains (the digg bar disapears). Does the referrer change depending on which frame the request comes from?


the link is in the context of the digg domain, so if you click it, even though the bar is no longer present, the referrer (or should I say referer) will still be digg.com. interestingly, if you ctrl-r, the same HTTP_REFERER header will be sent. but ctrl-l, cr will blank the header & you'll get the regularly scheduled content.


I see his point, but I'm not sure that "go fuck yourself" is the most effective way of making it. http://digg.com/d1oNOZ


I don't know, "go fuck yourself" sounds pretty unambiguous to me. What is there to explain? Digg knows exactly what they're doing, and that's exactly the reaction they deserve, IMO.


There is something to be said for manners though.


It is a daring way of making it.


Doesn't Facebook do pretty much the exact same thing?


They're not being advertised as a URL shortener though.


As does HootSuite: http://hootsuite.com/

Personally, I don't get why Gruber is so upset. There is an option to always hide the DiggBar. Hover over the X on the right and click the down arrow. Then there's a link that sets a cookie so you never see it again.

To me, he just sounds like a grumpy old man. The thing is useful, simple, and non-intrusive if you don't want to see it. No need to get profane about it...


He's not worried about it on the client side. He's worried about it from the server side. As was really, really clear from reading the article.

Might shed some light on the downmods.


Although your comment is all kinds of wrong, it's the bit about being "profane" which really gets my goat.

I mean, seriously. It is 2009. We are all adults. Are you honestly telling me you are offended, even in the slightest, by hearing the word "fuck"? If so - you got problems.

Swear words are part of the language. Whether one uses them or not depends on the circumstance - inopportune or over-use gets you marked down as lacking class or civility, warranted use is justified and commendable. This is the latter IMO. I personally applaud Gruber telling Digg to "go fuck yourself". That's exactly what I thought, too, and they deserve nothing better.

By trying to label and dismiss his justifiable reaction as "profane", though, you sound not only self-righteous, but as if you are attempting to discredit his argument using moral labels - like someone who is "profane" doesn't merit hearing out. Well, if that's what you think, you can go fuck yourself, too.


I don't have a problem with profanity, but I think it's over the top here. It's meant to be a severe response to a severe offense. I don't think this warrants that. If we use it too much, it loses its punch. I want my "fuck"s to still mean something! It's becoming an adjective, which means my anger becomes subdued.


It goes against the grain of the web, that's why. Sites that connect so many users to so much content should not do that.


But is there a logical reason to not do it?


It goes against the grain of the web, that's why. Sites that connect so many users to so much content should not do that.


I want to bookmark those pages as their are, not as digg pages. I do not know but I think this is going to backfire on Digg in the long run.


Assuming he uses Apache, why not just use a RewriteCond for that referrer and redirect to such a page? Executing that regex on every page is a performance hit, and generally I prefer to use Apache for stuff like this.

If you do use the supplied PHP code on your website, I recommend using strpos() or strstr() instead of preg_match().


Maybe he knows what kind of performance margins he has.


What do you mean by that? At the very least, most PHP devs know that strpos/strstr are much, much faster than a regular expression.


Unless page load times are affecting your browsing experience, why bother optimizing when a regular expression is so clear and simple.


You know what, you're right. I was thinking of something like:

  if (strpos('http://digg.com/', $_SERVER['HTTP_REFERER'])) 
     header('Location: whateverPage');
But that would block all traffic from Digg, including links in comments, etc. To perform the same check as the regex would require much more code.

However, I stand by my Apache recommendation as the best option.


erlanger, put a newline somewhere in your code! It's breaking the page.


Too late to edit. It doesn't force a scrollbar even in NetNewsWire though, so you might just want to widen the window a bit.


Didn't Apache use regular expresions for mod_rewrite?


Yes, but I've never heard of RewriteConds/Rules affecting scalability. It's common knowledge to only use preg_match, etc. in PHP if you're performing a very complex search. Of course, this is not a huge deal, but I feel that if you're advising others to use such a simple piece of code, it should be as perfect as possible.


Or you can just use the DiggBar disable feature that it provides.


"No, wait...." moment in 3..2..1


I'll explain, The problem is you seeing the links its that google will index the digg links to your site, people will pass around the digg links to your site. You'll see the digg link for every link you click on too.


Digg did a blog post yesterday explaining all the steps they took to give the page juice to the content and not to their URL, so it shouldn't hurt the content-site's SEO (using rel=canonical, et cetera).

http://blog.digg.com/?p=636




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: