Skip to content

Instantly share code, notes, and snippets.

@phuedx
Last active June 28, 2024 05:49
Show Gist options
  • Save phuedx/a438e9b8596bdedcdfcfa01b57762e0d to your computer and use it in GitHub Desktop.
Save phuedx/a438e9b8596bdedcdfcfa01b57762e0d to your computer and use it in GitHub Desktop.
Distraction-free YouTube

Distraction-free YouTube

Hide the distracting parts of YouTube!

Install directly with Stylus

/* ==UserStyle==
@name Distraction-free YouTube
@namespace phuedx
@version 0.3.0
@description Hide the distracting parts of YouTube!
@author Sam Smith (https://github.com/phuedx)
@homepageURL https://gist.github.com/phuedx/a438e9b8596bdedcdfcfa01b57762e0d
@updateURL https://gist.githubusercontent.com/phuedx/a438e9b8596bdedcdfcfa01b57762e0d/raw/distraction-free-youtube.user.css
@license GPL-3.0-or-later
@preprocessor stylus
@var checkbox hide-shorts "Hide Shorts?" 1
@var checkbox hide-chat "Hide chat replay?" 1
@var checkbox hide-comments "Hide comments?" 1
@var checkbox hide-related "Hide related?" 1
==/UserStyle== */
@-moz-document domain("www.youtube.com") {
if (hide-shorts) {
a[title="Shorts"] {
display: none !important;
}
ytd-rich-section-renderer:has(ytd-rich-shelf-renderer[is-shorts]) {
display: none;
}
yt-tab-shape[tab-title="Shorts"] {
display: none;
}
ytd-item-section-renderer:has(.ytd-reel-shelf-renderer) {
display: none;
}
ytd-shorts {
display: none;
}
yt-chip-cloud-chip-renderer:has([title="Shorts"]) {
display: none;
}
}
if (hide-chat) {
#chat-container {
display: none;
}
}
if (hide-comments) {
#comment-teaser,
ytd-item-section-renderer[section-identifier="comment-item-section"] {
display: none;
}
}
if (hide-related) {
#bottom-grid,
#related {
display: none !important;
}
#secondary:has(#playlist[hidden]) {
display: none;
}
#columns:has(#playlist[hidden]) {
max-width: none;
}
#columns:has(#playlist[hidden]) #primary {
max-width: none;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment