Last active
April 17, 2022 02:28
-
-
Save 8dcc/829b02737885955ad6a9aef7a09b43c9 to your computer and use it in GitHub Desktop.
Userscript for removing the suggestions on youtube. Useful if you use youtube on a vertical monitor.
This file contains hidden or 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 Remove suggestions YouTube | |
// @namespace Violentmonkey Scripts | |
// @include *://*.youtube.com/* | |
// @grant GM_addStyle | |
// @run-at document-idle | |
// @author Null (r4v10l1) | |
// ==/UserScript== | |
GM_addStyle (` | |
#secondary { | |
width: 100%; | |
} | |
#comments { | |
display: none; | |
} | |
ytd-watch-flexy[flexy] #secondary.ytd-watch-flexy { | |
width: 100% !important; | |
} | |
`) | |
function checkShit(cdelay) { | |
if (document.getElementById("primary-inner") != null) { | |
console.log("[YTCleaner] Found primary-inner..."); | |
move("secondary", "primary-inner"); | |
} else { | |
console.log("[YTCleaner] Can't find primary inner...") | |
setTimeout(function(){ checkShit(cdelay); }, cdelay); | |
} | |
} | |
function move(source, target) { | |
var source_e = document.getElementById(source); | |
var target_e = document.getElementById(target); | |
target_e.appendChild(source_e); | |
} | |
var DELAY = 500; // ms | |
console.log("[YTCleaner] Started...") | |
setTimeout(function(){ checkShit(DELAY); }, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UPDATE: Replaces comments for video suggestions.