

How to block the DiggBar - fromedome
http://daringfireball.net/2009/04/how_to_block_the_diggbar

======
miles

      <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>

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

~~~
miles
Thanks, erlanger!

------
bonaldi
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.

~~~
GHFigs
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.

~~~
bonaldi
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)

------
mikeyur
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.

~~~
dablya
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?

~~~
throw_away
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.

------
fuzzmeister
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?

~~~
ojbyrne
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.

~~~
Hoff
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.

~~~
ojbyrne
Curious - which one?

------
tomsaffell
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>

~~~
sho
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.

~~~
erlanger
There is something to be said for manners though.

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

~~~
timdorr
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...

~~~
erlanger
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.

~~~
indiv
But is there a logical reason to not do it?

~~~
erlanger
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.

------
Fuca
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.

------
erlanger
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().

~~~
tjogin
Maybe he knows what kind of performance margins he has.

~~~
erlanger
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.

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

~~~
erlanger
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.

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

~~~
erlanger
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.

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

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

~~~
reconbot
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.

~~~
calvin
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>

