UserJS to fix link underline colors
Sunday, August 28, 2005 11:26:44 PM
As most of us know, Opera has a very strict interpretation of the standards. One example is the underline color used for links when the deprecated <font color="whatever"> tag is used inside a link. If you've used Opera long enough, I'm sure you've run across sites whose links just look wrong -- the text is one color, but the underline color is something completely different. For example, see the red headlines on the DrudgeReport, or the red section headers on the NYTimes, or even the Sports section on Excite.
To cope with this, I've developed the following User JavaScript that will seek-out these links, and attempt to correct the visual soup...
...when complete, the modified links will resemble both MSIE and Firefox rendering.
I hope you find it useful.
To cope with this, I've developed the following User JavaScript that will seek-out these links, and attempt to correct the visual soup...
[B]document.addEventListener("load",
function() {
if (!document.getElementsByTagName("font").length) return;
for (var i = 0, link; link = document.links[ i ]; i++) {
if (link.style.color) continue;
var fonts = link.getElementsByTagName("font");
var fontRE = /<font[^>]*color=[\w\W]*$/i;
if (!fonts.length || !link.innerHTML.match(fontRE, "")) continue;
for (var n = 0, c; n < fonts.length; n++) {
if (c = fonts[n].getAttribute("color")) {
link.style.color = c;
break;
}
}
}
}, false);[/B]
...when complete, the modified links will resemble both MSIE and Firefox rendering.
I hope you find it useful.

Laurens BosscherDolfhinDC # Sunday, August 28, 2005 11:26:44 PM
I added it to my UserJS and it seems to work perfectly fine
Thanks
Lee HarveyLee_Harvey # Sunday, August 28, 2005 11:26:44 PM
<http://userjs.org/scripts/general/fixes/fix-font-tag-underline>
Thanks for the kind feedback.