YouTube Always Hoverable ProgressBar

Makes progressbar hoverable from the very beginning (also works when paused).

当前为 2021-11-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name YouTube Always Hoverable ProgressBar
  3. // @namespace https://github.com/Amadeus-AI
  4. // @version 1.0.1
  5. // @description Makes progressbar hoverable from the very beginning (also works when paused).
  6. // @icon https://www.youtube.com/s/desktop/3748dff5/img/favicon_48.png
  7. // @author AmadeusAI
  8. // @match *://www.youtube.com/*
  9. // @license MIT
  10. // ==/UserScript==
  11. /*jshint esversion: 6 */
  12.  
  13. var InstantBar =
  14. {
  15. css :
  16. `
  17. .ytp-chrome-bottom { opacity: 0 }
  18. .ytp-gradient-bottom { opacity: 0 }
  19. .html5-video-player:hover .ytp-chrome-bottom{ opacity: 1 }
  20. .html5-video-player:hover .ytp-gradient-bottom{ opacity: 1 }
  21.  
  22. `,
  23.  
  24. apply : function()
  25. {
  26. if (typeof GM_addStyle !== "undefined")
  27. {
  28. GM_addStyle(InstantBar.css);
  29. }
  30. else
  31. {
  32. let styleNode = document.createElement("style");
  33. styleNode.appendChild(document.createTextNode(InstantBar.css));
  34. (document.querySelector("head") || document.documentElement).appendChild(styleNode);
  35. }
  36. },
  37.  
  38. start : function()
  39. {
  40. // To overwrite youtube's default behavior
  41. setTimeout(InstantBar.apply, 0);
  42. }
  43. };
  44.  
  45. InstantBar.start();