Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i check if a link has been visited?

I am writing a userscript for myself and i have a list of permalinks and i'd like to hide the ones i already visited. I was thinking i can use jquery and check if the link has been visited (default color=purple) and if so hide the element.

However... i cant figure out how to actually check this. .attr('style'); only gets me border: none while .css() is invalid.

How might i check if the link has been clicked on? I am testing on firefox 4.0.1 with greasemonkey but i'll be using it on chrome.


2 Answers

The color checking shouldn't work anymore. Since this security flaw is fixed.

like image 60
Johni Avatar answered Nov 24 '25 20:11

Johni


a:visited is the selector you are looking for. This will return all visited links in the document.

a:visited {display: none;}
like image 41
Josh Avatar answered Nov 24 '25 22:11

Josh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!