// ==UserScript== // @name Minimal YouTube // @namespace krisyotam // @version 1.0 // @description Hide recommendations, sidebar, comments, shorts // @match *://www.youtube.com/* // @match *://youtube.com/* // @run-at document-start // ==/UserScript== (function() { 'use strict'; const css = ` /* Hide sidebar, recommendations, related videos */ #secondary, #secondary-inner, #related, ytd-watch-next-secondary-results-renderer { display: none !important; } /* Hide mini guide (left sidebar) */ ytd-mini-guide-renderer, tp-yt-app-drawer, #guide-button { display: none !important; } /* Hide voice search and extra buttons */ #top-level-buttons-computed, #voice-search-button, .ytd-masthead #buttons { display: none !important; } /* Hide comments */ ytd-comments#comments { display: none !important; } /* Hide shorts */ ytd-rich-section-renderer, ytd-reel-shelf-renderer, [is-shorts], ytd-grid-video-renderer:has(ytd-thumbnail-overlay-time-status-renderer[overlay-style="SHORTS"]), ytd-item-section-renderer:has(ytd-thumbnail-overlay-time-status-renderer[overlay-style="SHORTS"]) { display: none !important; } /* Remove left margin from page */ #page-manager { margin-left: 0 !important; } ytd-app[mini-guide-visible] ytd-page-manager.ytd-app { margin-left: 0 !important; } /* Center and expand video player */ #columns { width: 100%; display: flex; align-items: center; justify-content: center; } #columns #primary { max-width: fit-content; } /* Full width video */ ytd-watch-flexy:not([theatre]):not([fullscreen]) .html5-video-container, ytd-watch-flexy:not([theatre]):not([fullscreen]) video { width: 100% !important; height: 100% !important; left: 0 !important; } /* Widen progress bar */ .ytp-chrome-bottom { width: calc(98%) !important; } `; const style = document.createElement('style'); style.textContent = css; document.documentElement.appendChild(style); })();