Detecting ‘rel=nofollow’ (Safari)

Filed under: Articles

rel=”nofollow”, is a new attribute for the HTML tag <A> for links. This attribute can be detected in your Safari browser using the following javascript code as a bookmark. Please note that this javascript code only works for Macintosh computers using the Safari web browser.

How to detect the attribute rel=”nofollow” in Safari browsers:

  1. Open up Safari
  2. From your menu, go to “Bookmarks” then “Show All Bookmarks”
  3. From your menu, go to “Bookmarks” then “Add Bookmark”
  4. Name the bookmark as you wish, something like “rel=nofollow”
  5. Select the bookmark folder “Bookmarks Bar” from the drop down menu, then click on “Add”
  6. Change the address of the bookmark to:
javascript:var%20a=document.getElementsByTagName('a');
for(var%20z=0;z%3Ca.length;%20z++){
if(a[z].rel==’nofollow’){
a[z].style.border=’1px%20solid%20%23F00′;}}

(Important: Please remove the line breaks - this javascript code is meant to be one line of code)

Testing the bookmark

  1. Visit our page, Attribute rel=”nofollow”
  2. Click on your new bookmark. You should see 4 links with a red border around them. These links are using the rel=”nofollow” attribute. See below image:

Screenshot of Safari highlighting of rel=nofollow

Don’t have Safari on your Mac OS X yet? Download Safari today! It’s the fastest browser for Mac OS X.

No Comments »

No comments yet.

Leave a comment