Highlite NoFollow in Internet Explorer

I don’t know why none of the toolbars that are available for internet explorer support this yet because it pretty stinkin’ easy to implement.  But, here you go…

One of the little know secrets of both Internet Explorer and FireFox is that you can run javascript from the address bar.  So, to get the nofollowed links to show with a red background, just paste this code into the address bar (all in one line):

javascript: var anchors;anchors = document.getElementsByTagName(“a”);var anchorIndex;for(anchorIndex = 0;anchorIndex < anchors.length;anchorIndex++) { if(anchors[anchorIndex].getAttribute(“rel”) && anchors[anchorIndex].getAttribute(“rel”)==”nofollow”) anchors[anchorIndex].style.backgroundColor=”red”;} void(0);

Now, I know what you’re thinking.

“There’s no way I’m going to copy and paste that code into the address bar every time I want to know if a site is implementing nofollow!”

Nope… and neither am I.  You see, you can activate the “Links” toolbar in Internet Explorer and add a shortcut that will do this automatically.  If you don’t have the Links toolbar active yet, just right click in the toolbar area of Internet Explorer and select “Links” from the menu.

Next, right click one of the links that are already there and select “Create Shortcut” from the menu.  This will create a new link button at the end of the toolbar.  Right click this new button and select “Properties” from the menu.

On the “General” tab, rename the button to “Show NoFollow”  or something else appropriate.  On the “Web Document” tab, copy and paste the code I gave you above into the URL field.

Now, whenever you want to see if no follow is being used on the page, just click the “Show NoFollow” button in the Links toolbar.

This script will display any nofollow links with a background color of red.  It will also only work if nofollow is the only value for the rel attribute.  This works most of the time because it normally IS the only value.

Related Post

2 Responses to “Highlite NoFollow in Internet Explorer”

  • Stephen:

    I’ve tried to use the script you posted, but its not working and I get a error in the bottom left corner of the browser each time I try to use it.

    Can you email or post more instructions?

  • Dave:

    Sorry, the double quotes seem to be getting “prettified” by WordPress. If you look closely, they are ending quote marks instead of boring code double quote marks. Fix that up and it will work.