If you need to show a different colors of visited link, you can use :visited CSS selector:

For security/privacy reasons this property can work only with:

Furthermore, you must set this option for both with and without :visited to make it work.
For more information click here: Mozilla: Privacy and the :visited selector

Javascript API

For advanced history management, you can use this JavaScript function that tells you if link has been visited or not:

Complete Example