News for hackers. Stuff that matters.
Re:How to block the DiggBar by miles on Friday April 10, 2009 @02:26AM (#555797)

  <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

Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @09:38AM (#556004)
Psst...indent your comment two spaces to display as code.
Re:How to block the DiggBar by miles on Friday April 10, 2009 @01:01PM (#556318)
Thanks, erlanger!
Re:How to block the DiggBar by bonaldi on Friday April 10, 2009 @06:39AM (#555906)
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.

Re:How to block the DiggBar by GHFigs on Friday April 10, 2009 @03:21PM (#556634)
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.
Re:How to block the DiggBar by bonaldi on Friday April 10, 2009 @03:36PM (#556664)
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)

Re:How to block the DiggBar by windsurfer on Friday April 10, 2009 @12:46PM (#556293)
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).
Re:How to block the DiggBar by joshu on Friday April 10, 2009 @05:13PM (#556814)
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.
Re:How to block the DiggBar by mikeyur on Thursday April 09, 2009 @11:39PM (#555657)
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.

Re:How to block the DiggBar by dablya on Thursday April 09, 2009 @11:56PM (#555670)
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?
Re:How to block the DiggBar by throw_away on Friday April 10, 2009 @12:44AM (#555716)
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.
Re:How to block the DiggBar by fuzzmeister on Friday April 10, 2009 @01:27AM (#555751)
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?
Re:How to block the DiggBar by ojbyrne on Friday April 10, 2009 @01:43AM (#555762)
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.
Re:How to block the DiggBar by Hoff on Friday April 10, 2009 @11:08AM (#556137)
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.
Re:How to block the DiggBar by ojbyrne on Friday April 10, 2009 @03:33PM (#556659)
Curious - which one?
Re:How to block the DiggBar by mechanical_fish on Friday April 10, 2009 @09:41AM (#556010)
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.

Re:How to block the DiggBar by andreyf on Friday April 10, 2009 @07:55AM (#555937)
A far more reasonable approach...

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

Re:How to block the DiggBar by tomsaffell on Friday April 10, 2009 @12:09AM (#555681)
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
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @12:27AM (#555700)
It is a daring way of making it.
Re:How to block the DiggBar by sho on Friday April 10, 2009 @02:13PM (#556502)
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.
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @05:00PM (#556797)
There is something to be said for manners though.
Re:How to block the DiggBar by tptacek on Friday April 10, 2009 @12:11AM (#555684)
Doesn't Facebook do pretty much the exact same thing?
Re:How to block the DiggBar by jonknee on Friday April 10, 2009 @12:53AM (#555724)
They're not being advertised as a URL shortener though.
Re:How to block the DiggBar by timdorr on Friday April 10, 2009 @12:31AM (#555702)
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...

Re:How to block the DiggBar by dave_au on Friday April 10, 2009 @06:16AM (#555896)
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.

Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @12:33AM (#555704)
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.
Re:How to block the DiggBar by indiv on Friday April 10, 2009 @01:24PM (#556372)
But is there a logical reason to not do it?
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @01:57PM (#556458)
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.
Re:How to block the DiggBar by sho on Friday April 10, 2009 @02:24PM (#556523)
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.

Re:How to block the DiggBar by timdorr on Friday April 10, 2009 @06:06PM (#556882)
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.
Re:How to block the DiggBar by Fuca on Friday April 10, 2009 @01:47PM (#556433)
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.
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @12:27AM (#555699)
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().

Re:How to block the DiggBar by tjogin on Friday April 10, 2009 @05:31AM (#555878)
Maybe he knows what kind of performance margins he has.
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @10:49AM (#556118)
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.
Re:How to block the DiggBar by cakeface on Friday April 10, 2009 @11:27AM (#556169)
Unless page load times are affecting your browsing experience, why bother optimizing when a regular expression is so clear and simple.
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @02:00PM (#556475)
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.

Re:How to block the DiggBar by sho on Friday April 10, 2009 @02:25PM (#556527)
erlanger, put a newline somewhere in your code! It's breaking the page.
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @04:56PM (#556791)
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.
Re:How to block the DiggBar by narag on Friday April 10, 2009 @11:00AM (#556129)
Didn't Apache use regular expresions for mod_rewrite?
Re:How to block the DiggBar by erlanger on Friday April 10, 2009 @11:03AM (#556134)
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.
Re:How to block the DiggBar by TwoBit on Friday April 10, 2009 @12:32AM (#555703)
Or you can just use the DiggBar disable feature that it provides.
Re:How to block the DiggBar by dablya on Friday April 10, 2009 @12:37AM (#555708)
"No, wait...." moment in 3..2..1
Re:How to block the DiggBar by reconbot on Friday April 10, 2009 @10:51AM (#556119)
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.
Re:How to block the DiggBar by calvin on Friday April 10, 2009 @12:05PM (#556227)
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