Last active
April 4, 2021 11:45
-
-
Save CairX/f3995c4d5df46305dbf197e1e764d87b to your computer and use it in GitHub Desktop.
YouTube: Hide Comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name YouTube: Hide Comments | |
// @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("comments").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 = "#comments { display: none; }"; | |
document.body.appendChild(style); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment