최근 코로나19 사태로 인해 유튜브로 뉴스를 자주 보게되는데 실시간 채팅이 기본적으로 활성화되어있어서 여간 거슬리는게 아니다. 영양가 없는 쓸데없는 얘기들이 막 스크롤되는걸 뭐 어쩌라는건지..
YouTube에서는 기본적으로 비활성시키는 옵션이 존재하지 않아서 그리스몽키 스크립트가 있나 찾아보니, 역시 있다!
이 사이트의 첫 번째 스크립트 말고 제일 아랫쪽에 보면 스크립트가 하나 더 있는데, 이걸 복사해서 사용하면 된다.
// ==UserScript==
// @name YouTube - Hide Live Chat
// @namespace https://gist.github.com/LazyMammal/1c60c45e9df26602f688d025f3b20f0c
// @version 0.3
// @description Hide live chat by default on live streams
// @author LM, bastiMQ, IrisNebula
// @match https://www.youtube.com/watch*
// @run-at document-end
// @grant none
// ==/UserScript==
function PressHideButton() {
var el = document.getElementById("show-hide-button");
if(el) {
while(el.children.length > 0) {
if(el.firstChild.getAttribute("id") == "button") {
el.firstChild.click();
console.log('Live Chat Hidden');
return true;
}
el = el.firstChild;
}
}
return false;
}
function KeepTrying(func, attempts, delayMillis) {
console.log('Trying to Hide Live Chat, remaining attempts: ' + attempts);
if(!func() && (attempts-1 > 0)) {
window.setTimeout(function() {
KeepTrying(func, attempts-1, delayMillis);
}, delayMillis);
}
}
(function() {
'use strict';
KeepTrying(PressHideButton, 12, 200);
})();
그리스몽키를 사용하려면 크롬에서 Tempermonkey를 설치해서 사용하면 된다. 크롬 익스텐션을 설치 후 새 스크립트를 만든 후 위의 코드를 전체 붙여넣기 하여 저장하면 된다.
YouTube를 다시 열어보면 실시간 채팅 창이 닫혀있는 채로 동영상이 재생된다.