To preserve users' privacy, Firefox and other browsers will lie to web applications under certain circumstances:
- The
window.getComputedStyle
method, and similar functions such aselement.querySelector
, will always return values indicating that a user has never visited any of the links on a page. - If you use a sibling selector such as
:visited + span
, the adjacent element (span
in this example) will be styled as if the link were unvisited. - In rare scenarios, if you're using nested link elements and the element being matched is different from the link whose presence in history is being tested, the element will be rendered as if the link were unvisited, as well.