weboholic.de

random rant-o-rama

Archive for the ‘bookmarklet’ tag

nofollow Bookmarklet

with one comment

Here is a smallish bookmarklet that highlights all links that are marked with the nofollow attribute. Just drag and drop it to your bookmarks bar.

show nofollow

In its current version the bookmarklet is very very simple: it just highlights nofollow-links and reports back the total number. However it only works on frameless documents.

Here’s the code in a readable <code>-block:

  1. javascript:(function(){
  2.   for (var i = 0, a = document.getElementsByTagName('a'), b = a.length, c = b; i < b; i++) {
  3.     a[i].rel.match(/nofollow/i) ? a[i].style.backgroundColor = '#ff0066' : c–;
  4.   }
  5.   alert(c);
  6. })();

That’s the shortest I could get. Have fun :).

P.S. You can test-drive it right away on this page: the about-link in the footer is a nofollow-link.

P.P.S. It’s the browser that turns a double minus into a single long dash.

Written by Никола

June 14th, 2008 at 12:39 pm

Clicky Web Analytics