Digg bar continues to frames websites and blogs, but do you know how to remove the Diggbar? The popular DiggBar lets you Digg, read comments, find related content, and share stuff from any page on the Web quickly and easily.
Disable Digg bar for Users
1. Digg Settings – If you are a Digg user, its easy to disable the Diggbar from your Settings > Viewing Preferences
2. Disable Diggbar using Greasemonkey – Firefox users can install Greasemonkey to modify the web and then use the Remove Digg bar userscript to stop the Diggbar from appearing.
Remove Diggbar for Bloggers, Site Owners
1. Disable Diggbar using Javascript – BloggingTips explains how adding a small framebreaker javascript code within your page <HEAD> tags can work. When you add this to your blog the visitor will still see the Digg Toolbar for a second or so and then it will be removed (So for the visitor to go back to Digg they would have to click the back button twice). But on javascript disabled browsers, this will not work.
<script type="text/javascript">
if (top !== self) top.location.href = self.location.href;
</script>
Farukat.es has a better code that prevents the Back button being broken
<script type="text/javascript">
if (top !== self && document.referrer.match(/digg.com/w{1,8}/)) {
top.location.replace(self.location.href);
}
</script>
Wikipedia has another framekiller code to let user know why they are being redirected with the use of a pop-up alert
<script type="text/javascript">
if (top !== self) {
alert('The URL '+self.location.href+' cannot be viewed inside a frame. You will be redirected.');
top.location.href = self.location.href;
}
</script>
2. Block Diggbar with PHP – DaringFireball explains how this is done by adding a small php code within the <HEAD> tags of your pages. He explains that the code first line uses a regular expression to check if the HTTP referrer looks like a DiggBar URL, and if the pattern matches, it prints a special message for Digg users and calls PHPs standard exit function, which stops the rest of the page from being transmitted. It doesnt attempt to block all referring URLs from Digg, just those that look like DiggBar pages.
<?php
if (preg_match('#http://digg.com/w{1,8}/*(?.*)?$#',
$_SERVER['HTTP_REFERER']) ) {
echo "<p>Special message for Digg users here.</p>";
exit;
}
?>
3. Remove Digg bar using WordPress plugins – No frames wordpress plugin removes the browser frames imposed on your site. It will detect these frames and break your site free presenting the user with your full page.
BUT WHY? Just incase you are still wondering why many people are blocking the Digg bar – Techcrunch had concerns that Digg was keeping all traffic on their site (instead of dugg links). Though Digg clarified that they had fixed SEO issues and webmaster concerns associated with the toolbar, some concerns still persist.