Alt To Hover

Changes the alt text to hover text on SE sites

  1. // ==UserScript==
  2. // @name Alt To Hover
  3. // @author AstroCB
  4. // @description Changes the alt text to hover text on SE sites
  5. // @version 1.2
  6. // @namespace https://github.com/AstroCB
  7. // @include http://*.stackexchange.com/questions/*
  8. // @include http://stackoverflow.com/questions/*
  9. // @include http://meta.stackoverflow.com/questions/*
  10. // @include http://serverfault.com/questions/*
  11. // @include http://meta.serverfault.com/questions/*
  12. // @include http://superuser.com/questions/*
  13. // @include http://meta.superuser.com/questions/*
  14. // @include http://askubuntu.com/questions/*
  15. // @include http://meta.askubuntu.com/questions/*
  16. // @include http://stackapps.com/questions/*
  17. // @include http://*.stackexchange.com/posts/*
  18. // @include http://stackoverflow.com/posts/*
  19. // @include http://meta.stackoverflow.com/posts/*
  20. // @include http://serverfault.com/posts/*
  21. // @include http://meta.serverfault.com/posts/*
  22. // @include http://superuser.com/posts/*
  23. // @include http://meta.superuser.com/posts/*
  24. // @include http://askubuntu.com/posts/*
  25. // @include http://meta.askubuntu.com/posts/*
  26. // @include http://stackapps.com/posts/*
  27. // @exclude http://*.stackexchange.com/questions/tagged/*
  28. // @exclude http://stackoverflow.com/questions/tagged/*
  29. // @exclude http://meta.stackoverflow.com/questions/tagged/*
  30. // @exclude http://serverfault.com/questions/tagged/*
  31. // @exclude http://meta.serverfault.com/questions/*
  32. // @exclude http://superuser.com/questions/tagged/*
  33. // @exclude http://meta.superuser.com/questions/tagged/*
  34. // @exclude http://askubuntu.com/questions/tagged/*
  35. // @exclude http://meta.askubuntu.com/questions/tagged/*
  36. // @exclude http://stackapps.com/questions/tagged/*
  37. // ==/UserScript==
  38. window.onload = function () {
  39. var images = document.getElementsByTagName("img");
  40. for (var i = 0; i < images.length; i++) {
  41. if (images[i].alt && !images[i].title && images[i].alt !== "enter image description here") {
  42. images[i].title = images[i].alt;
  43. }
  44. }
  45. };

QingJ © 2025

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