1

I'm trying to use a:visited img in a userstyle for YouTube, but it has no effect:

a:visited img {
    filter: grayscale(100%) !important;
}

On the other hand, if I instead use a:visited and a img, they work fine:

a:visited {
    color: red !important;
}

a img {
    filter: grayscale(100%) !important;
}

Why doesn't a:visited img work?

Kayce Basques
  • 23,849
  • 11
  • 86
  • 120
root
  • 1,812
  • 1
  • 12
  • 26
  • 2
    it's a security issue: https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector browser don't allow a lot of styling with :visited – Temani Afif Jan 14 '19 at 22:13
  • I think you can add a class after clicking the link. This way, all visited link will have a class. You can then style by class. – Pablo Darde Jan 14 '19 at 23:43

0 Answers0