A Less Distracting YouTube

YouTube’s homepage and recommended videos sidebar are the platform’s most distracting features for me. I remove them with a userscript. In Firefox, I use the Violentmonkey plugin (source code here). Similar plugins are available for Chrome.

Import the following script, and watch the homepage and sidebar disappear.

// ==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);

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.