YoutubeClock

Add a simple clock to the youtube bar so that you don't need to close fullscreen to see it.

  1. // ==UserScript==
  2. // @name YoutubeClock
  3. // @namespace https://oxodao.fr/
  4. // @version 1
  5. // @description Add a simple clock to the youtube bar so that you don't need to close fullscreen to see it.
  6. // @author Nathan <Oxodao> JANCZEWSKI
  7. // @match https://www.youtube.com/watch?v=*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. let bar = document.getElementsByClassName("ytp-right-controls")[0];
  15. let clock = document.createElement("span");
  16. clock.classList.add("ytp-time-display");
  17. clock.innerText = "Toto";
  18.  
  19. function clockTime() {
  20. var today = new Date();
  21. var h = today.getHours();
  22. var m = today.getMinutes();
  23. var s = today.getSeconds();
  24. if (h < 10) h = "0" + h;
  25. if (m < 10) m = "0" + m;
  26. if (s < 10) s = "0" + s;
  27. clock.innerText = h + ":" + m + ":" + s;
  28. setTimeout(clockTime, 500);
  29. }
  30.  
  31. clockTime();
  32.  
  33. bar.insertBefore(clock, bar.childNodes[0]);
  34. })();

QingJ © 2025

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