YouTube Progressbar Updater

Forces the YouTube progress bar to update even when it's supposed to be hidden.

  1. // ==UserScript==
  2. // @name YouTube Progressbar Updater
  3. // @version 0.2
  4. // @description Forces the YouTube progress bar to update even when it's supposed to be hidden.
  5. // @author Workgroups
  6. // @match *://www.youtube.com/*
  7. // @grant none
  8. // @namespace https://gf.qytechs.cn/users/14014
  9. // ==/UserScript==
  10.  
  11. var findVideoInterval = setInterval(function() {
  12. var ytplayer = document.querySelector(".html5-video-player:not(.addedupdateevents)");
  13. if (!ytplayer) {
  14. return;
  15. }
  16. ytplayer.className+=" addedupdateevents";
  17. var video = ytplayer.querySelector("video");
  18. var progressbar = ytplayer.querySelector(".ytp-play-progress");
  19. var loadbar = ytplayer.querySelector(".ytp-load-progress");
  20. if (!video || !progressbar || !loadbar) {
  21. return;
  22. }
  23. video.addEventListener("timeupdate",function() {
  24. progressbar.style.transform = "scaleX("+(video.currentTime/video.duration)+")";
  25. });
  26. video.addEventListener("progress",function() {
  27. loadbar.style.transform = "scaleX("+(video.buffered.end(video.buffered.length-1)/video.duration)+")";
  28. });
  29. },500);

QingJ © 2025

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