Remove ads Twitch

Continue to view twitch stream when ad

  1. // ==UserScript==
  2. // @name Remove ads Twitch
  3. // @namespace https://gf.qytechs.cn/fr/users/11667-hoax017
  4. // @match https://www.twitch.tv/*
  5. // @grant none
  6. // @version 1.0
  7. // @author Hoax017
  8. // @license MIT
  9. // @description Continue to view twitch stream when ad
  10. // ==/UserScript==
  11. let switched = false
  12. function antiAdd() {
  13. const miniVideoparent = document.querySelector("div.picture-by-picture-player")
  14. const isOpen = !miniVideoparent.className.includes("picture-by-picture-player--collapsed")
  15. const mainVideo = document.querySelector("div.video-ref video")
  16. if (!isOpen) {
  17. if (switched) {
  18. mainVideo.muted = false
  19. switched = false
  20. }
  21. return;
  22. }
  23. const miniVideo = miniVideoparent.querySelector("video")
  24. // deplacer l'element mini video a coter de main video
  25. mainVideo.parentElement.appendChild(miniVideo)
  26. mainVideo.parentElement.appendChild(mainVideo.parentElement.querySelector("div"))
  27. // unmute mini video
  28. miniVideo.muted = mainVideo.muted
  29. mainVideo.muted = true
  30. switched = true
  31. }
  32. setInterval(antiAdd, 500)

QingJ © 2025

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