Twitch Pause Carousel

Pause home page carousel

  1. // ==UserScript==
  2. // @name Twitch Pause Carousel
  3. // @namespace https://github.com/dotmick/
  4. // @version 0.2
  5. // @description Pause home page carousel
  6. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
  7. // @author dotmick
  8. // @match *://www.twitch.tv
  9. // @grant none
  10. // @license GPL-3.0-or-later
  11. // ==/UserScript==
  12.  
  13.  
  14. // Ugly, but that works
  15. $(document).ready(() => {
  16. console.log('Running Twitch Pause Carousel (TPC)');
  17.  
  18. var checkExist = setInterval(function() {
  19. if ($('.video-player__container video').get(0).readyState == 4) {
  20. console.log("TPC – Video ready to be paused");
  21. clearInterval(checkExist);
  22. var nbPausing = 100;
  23. var forcePausing = setInterval(function() {
  24. console.log("TPC – Forcing pause...");
  25. $('.video-player__container video').get(0).pause();
  26. nbPausing--;
  27. if(nbPausing == 0)
  28. {
  29. clearInterval(forcePausing);
  30. console.log("TPC – Forcing pause done (x" + nbPausing + ")");
  31. }
  32.  
  33. }, 100);
  34. }
  35. }, 100);
  36. });

QingJ © 2025

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