YouTube hide chat

Hide live chat on live streams

目前為 2022-04-29 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name YouTube hide chat
  3. // @name:es YouTube chat oculto
  4. // @description Hide live chat on live streams
  5. // @description:es Esconde el chat de las transmisiones en vivo
  6. // @version 0.3
  7. // @author IgnaV
  8. // @match https://www.youtube.com/watch*
  9. // @icon http://youtube.com/favicon.ico
  10. // @namespace http://tampermonkey.net/
  11. // @license MIT
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const hideChat = () => {
  19. let attemptsToHide = 0;
  20. const intervalId = setInterval(() => {
  21. const chat = document.querySelector('#show-hide-button > ytd-toggle-button-renderer');
  22.  
  23. if (chat) {
  24. chat.click();
  25. console.log('Chat hidden!');
  26. clearInterval(intervalId);
  27. return;
  28. } else if (attemptsToHide < 20) {
  29. attemptsToHide++;
  30. console.log(`Attempts to hide the chat ${attemptsToHide}`);
  31. } else {
  32. clearInterval(intervalId);
  33. }
  34. }, 1000);
  35. }
  36. window.addEventListener('urlchange', hideChat);
  37. hideChat();
  38. })();

QingJ © 2025

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