From 20fbf9bba354121569b525b8616304eb0ef19298 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Fri, 11 Oct 2002 09:20:18 +0000 Subject: [PATCH] Mark links as visited when they get opened in new tabs/windows. --- browser/base/content/contentAreaClick.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/browser/base/content/contentAreaClick.js b/browser/base/content/contentAreaClick.js index 7e10ce29be5c..c1c4a1b65e2c 100644 --- a/browser/base/content/contentAreaClick.js +++ b/browser/base/content/contentAreaClick.js @@ -201,9 +201,17 @@ result = true; } - if (result && linkNode && !linkNode.style.color) - linkNode.style.color = "-moz-visitedhyperlinktext"; - + if (result && linkNode) { + var computedOldColor = linkNode.ownerDocument.defaultView.getComputedStyle(linkNode,"").getPropertyValue("color"); + var oldStyleColor = linkNode.style.color; + linkNode.style.color = "-moz-hyperlinktext"; + var computedNewColor = linkNode.ownerDocument.defaultView.getComputedStyle(linkNode,"").getPropertyValue("color"); + if (computedNewColor == computedOldColor) + linkNode.style.color = "-moz-visitedhyperlinktext"; + else + linkNode.style.color = oldStyleColor; + } + // let someone else deal with it return result; }