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