Skip to content

Instantly share code, notes, and snippets.

@IMcPwn
Last active January 19, 2017 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IMcPwn/c3a2da47ba3670254406d499dbf54830 to your computer and use it in GitHub Desktop.
Save IMcPwn/c3a2da47ba3670254406d499dbf54830 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Hide YouTube Comments
// @namespace https://imcpwn.com
// @description Hide the YouTube Comments with no option to re-enable.
// @version 1.0.0
// @author Carleton Stuberg
// @copyright 2016+, Carleton Stuberg
// @license MIT; http://opensource.org/licenses/MIT
// @include http://www.youtube.com/watch*
// @include https://www.youtube.com/watch*
// @include http://youtube.com/watch*
// @include https://youtube.com/watch*
// @run-at document-end
// @grant none
// ==/UserScript==
(function () {
var comments = document.getElementById("watch-discussion");
var toggleLoc = document.getElementById("watch8-secondary-actions");
var toggleDiv = document.createElement("div");
toggleDiv.style.textAlign = "center";
toggleDiv.innerHTML = "<button id='toggleBtn' class='yt-uix-button yt-uix-button-default' disabled> Comments are disabled </button>";
comments.parentNode.insertBefore(toggleDiv, comments);
comments.style.display = "none";
var toggleBtn = document.getElementById("toggleBtn");
}) ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment