How to get rid of the DiggBar on Tumblr
I’ll let someone else explain why the DiggBar sucks, or why it doesn’t, but if you want to block it (and others, like Facebook’s) on your Tumblr blog, simply add this slightly modified frame-busting JavaScript to your theme:
<script type="text/javascript">
if ((top !== self) &&
(document.referrer != 'http://www.tumblr.com/customize')) {
top.location.replace(self.location.href);
}
</script>
The second condition of the if is important because without it, the script will break Tumblr’s “customize” page, and you won’t be able to modify your theme again.
This might not help with whatever side effects the DiggBar may cause on your PageRank, but at least it’ll stop your site from looking like this in the future.
Update: If you only want to block the DiggBar, use this instead:
<script type="text/javascript">
if ((top !== self) &&
(document.referrer.match(/http:\/\/digg.com\/\w{1,8}\/*(\?.*)?/))) {
top.location.replace(self.location.href);
}
</script>
Another update: Faruk Ateş says that using top.location.replace prevents the Back button from being broken. I updated the code to reflect that.
Notes
-
workandtumble liked this
-
ericalba liked this
-
roamin liked this
-
none00 liked this
-
klaatu reblogged this from hacks
-
halostatue reblogged this from guillee and added:
saved for my own reference when I update my
-
beingrandom reblogged this from hacks
-
freitag liked this
-
khanhtoan reblogged this from xoai
-
tungjacob liked this
-
bandit reblogged this from matthewb
-
xoai reblogged this from hacks
-
eagereyes reblogged this from guillee and added:
It’s not just tumblr,...every webpage. I just added it...all...
-
chartier reblogged this from hacks and added:
A simple way to disable Digg’s traffic- and mindshare-stealing new DiggBar on Tumblr blogs.
-
timparker liked this
-
hacks reblogged this from matthewb
-
mojaam liked this
-
sneak liked this
-
darknessfalls liked this
-
jratlee liked this
-
thebronzemedal liked this
-
bringpinkwater liked this
-
jorgeq liked this
-
dydric liked this
-
ericstrauss liked this
-
puntosdevista liked this
-
siddman liked this
-
kiyo liked this
-
esquareda liked this
-
jarredbishop liked this
-
xla reblogged this from matthewb
-
mattschwarz reblogged this from matthewb
-
hunterpryor liked this
-
livesophia liked this
-
sparo reblogged this from matthewb
-
matthewb reblogged this from inky and added:
Guillermo Esteves posted a JavaScript fix to disable use of the Diggbar on Tumblr sites. Below is a
-
skelly liked this
-
fleetfootedfox liked this
-
brilliantology liked this
-
inky reblogged this from guillee and added:
framekiller that won’t...‘customize’ page.
-
guillee posted this