Skip to content

Instantly share code, notes, and snippets.

@tomcur
Created November 13, 2020 07:12
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 tomcur/74061501ffefea919d8b87edc56adf2c to your computer and use it in GitHub Desktop.
Save tomcur/74061501ffefea919d8b87edc56adf2c to your computer and use it in GitHub Desktop.
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