Skip to content

Instantly share code, notes, and snippets.

@CairX
Last active April 4, 2021 11:46
Show Gist options
  • Save CairX/51319ed39957ea45ff7530e9b3dbe683 to your computer and use it in GitHub Desktop.
Save CairX/51319ed39957ea45ff7530e9b3dbe683 to your computer and use it in GitHub Desktop.
YouTube: Hide Live Chat
// ==UserScript==
// @name YouTube: Hide Live Chat
// @namespace https://gist.github.com/CairX
// @version 0.1
// @grant none
// @include https://www.youtube.com/*
// @run-at document-end
// ==/UserScript==
// An alternative approach would be:
// document.getElementById("chat").remove();
//
// However that does not work as YouTube manipulates the DOM after
// the page is loaded and therefore the comments-element doesn't exist
// at the time of execution.
var style = document.createElement("style");
style.innerHTML = "#chat { display: none; }";
document.body.appendChild(style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment