Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This userscript removes YouTube's homepage and suggested videos.
// ==UserScript==
// @name Youtube minimalism
// @namespace https://churchman.nl/
// @match https://*.youtube.com/*
// @grant none
// ==/UserScript==
function del(selectors) {
selectors.forEach((selector) => {
const ele = document.querySelector(selector);
if (ele) {
ele.parentNode.removeChild(ele);
}
});
}
setInterval(function() {
del([
'ytd-browse[page-subtype="home"]',
'.html5-endscreen',
'.ytp-ce-element',
'.ytp-ce-covering-overlay',
'.ytp-ce-element-shadow',
'.ytp-ce-covering-image',
'.ytp-ce-expanding-image',
'.ytp-ce-element.ytp-ce-video.ytp-ce-element-show',
'.ytp-ce-element.ytp-ce-channel.ytp-ce-channel-this',
'.ytp-pause-overlay',
'#secondary'
]);
}, 250);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.