

Show HN: Greasemonkey script to highlight rel= links - nitrogen

This is a userscript I wrote because I was curious how HN decides to put the nofollow attribute on links.  Though I'm an experienced C programmer (among other languages), I decided it was time to learn browser-hosted JavaScript and wrote a Greasemonkey script instead of using one of the existing tools or userscripts.<p>As such, the quality's probably not great, but I'm throwing it out there anyway and would welcome any feedback or suggestions of better techniques to accomplish the same thing.  If your curious as I was what the HN upvote threshold is for removing the nofollow tag, install the script and find out.<p>Here's the URL: http://userscripts.org/scripts/show/96207
======
jcr
Edit: ./firefox/<profile_name>/chrome/userContent.css

a[rel] { background-color: #ff00ff !important; }

The above will change any anchor with any 'rel' attribute, but if you want to
get fancy by only modifying anchors with 'rel' attribute having 'nofollow'
then you'd need to realize rel is a space separated list.

a[rel~="nofollow"] {background-color: #ff00ff !important; }

Given that some idiots incorrectly use semi-colon or comma delimited lists for
rel, you'd be better off with using the "contains" idiom.

a[rel*="nofollow"] {background-color: #ff00ff !important; }

[http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html...](http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/index.html)

If you're really have your heart set on using in-browser javascript, look into
userChrome.js --You can do many amazing things with userChrome.js due to when
it runs, and it's access to the browser.

<http://userchromejs.mozdev.org/>

------
nitrogen
I can't believe I typed "If your curious..." instead of "If you're curious..."
I must've hit maxvisit before I had a chance to edit it or something.

