Created
June 12, 2018 15:12
-
-
Save neighthan/cd92abbaf27d0570830eed181d95a979 to your computer and use it in GitHub Desktop.
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 Focused YouTube | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Remove distracting things (comments, other video suggestions) from YouTube video pages | |
// @author Nathan Hunt | |
// @match https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict' | |
let waitAndHide = function(id) { | |
setTimeout(function () { | |
let element = document.getElementById(id) | |
console.log(`Trying to hide ${id} (${element}).`) | |
if (element) { | |
element.style.display = 'none' | |
} else { | |
waitAndHide(id) | |
} | |
}, 1000) | |
} | |
waitAndHide('comments') | |
// the videos on the side, including Up Next | |
waitAndHide('items') | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment