Skip to content

Instantly share code, notes, and snippets.

@8dcc
Last active April 17, 2022 02:28
Show Gist options
  • Save 8dcc/829b02737885955ad6a9aef7a09b43c9 to your computer and use it in GitHub Desktop.
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.
// ==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);
@8dcc
Copy link
Author

8dcc commented Apr 17, 2022

UPDATE: Replaces comments for video suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment