Twitter.com: image alt presence revealer

Gives slight visual clue on elements that (don't) lack accessible descriptions.

  1. /* ==UserStyle==
  2. @name Twitter.com: image alt presence revealer
  3. @namespace myfonj
  4. @version 1.0.3
  5. @description Gives slight visual clue on elements that (don't) lack accessible descriptions.
  6. @author myfonj
  7. ==/UserStyle== */
  8.  
  9. @-moz-document domain("twitter.com") {
  10. /*
  11. https://gf.qytechs.cn/en/scripts/428284/versions/new
  12. */
  13. /*
  14. § mark alt-less images
  15. twitter has nasty habit of using [aria-label] without value
  16. luckilly, from CSS POW it is same as using [aria-label=""]
  17. exceptions:
  18. - avatars (see end of stylesheet)
  19. */
  20. [aria-label=""]:not([role]),
  21. [aria-label="Image"],
  22. [aria-label="Embedded video"],
  23. img:not([alt]),
  24. img[alt="Image"],
  25. img[alt=""],
  26. img[alt="Embedded video"]
  27. {
  28. outline: 0.3em inset rgba(255,0,0,0.3) !important;
  29. outline-offset: -.5em;
  30. }
  31. /*
  32. § mark imges with alternative texts
  33. exceptions:
  34. - emoji
  35. */
  36. [aria-label
  37. ][data-testid*="photo"i
  38. ]:not([aria-label=""]
  39. ):not([aria-label="Image"]
  40. ):not([aria-label="Embedded video"]
  41. ),
  42. [aria-label
  43. ][data-testid*="preview"i
  44. ]:not([aria-label=""]
  45. ):not([aria-label="Image"]
  46. ):not([aria-label="Embedded video"]
  47. ) [aria-label],
  48. img[alt
  49. ]:not([alt=""]
  50. ):not([alt="Image"]
  51. ):not([alt="Embedded video"]
  52. ):not([src*=".twimg.com/emoji/v"])
  53. {
  54. outline: 0.3em inset rgba(0,255,0,0.3) !important;
  55. outline-offset: -.5em;
  56. }
  57. /*
  58. § exception for avatars
  59. _all_ avatars have void aria-labels and alts
  60. (images with alts are invisible anyway, so )
  61. */
  62. [style="padding-bottom: 100%;"
  63. ] + div > div[aria-label=""]
  64. {
  65. outline: none !important;
  66. }
  67.  
  68. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址