Detecting ‘rel=nofollow’ (Safari)
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:
- Open up Safari
- From your menu, go to “Bookmarks” then “Show All Bookmarks”
- From your menu, go to “Bookmarks” then “Add Bookmark”
- Name the bookmark as you wish, something like “rel=nofollow”
- Select the bookmark folder “Bookmarks Bar” from the drop down menu, then click on “Add”
- 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
- Visit our page, Attribute rel=”nofollow”
- 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:

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