Skip to content

Instantly share code, notes, and snippets.

@insin
Last active December 26, 2023 02:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save insin/b735312d8ff969b1d7e5e18e73b6ea16 to your computer and use it in GitHub Desktop.
Save insin/b735312d8ff969b1d7e5e18e73b6ea16 to your computer and use it in GitHub Desktop.
Hide YouTube Shorts - use with the Stylus extension: https://github.com/openstyles/stylus#stylus
/* Nav item */
a[title="Shorts"],
/* Video shelf in Home and Subscriptions */
ytd-rich-shelf-renderer[is-shorts],
/* Video shelf in Search */
ytd-reel-shelf-renderer {
display: none !important;
}
@supports selector(:has(*)) {
/* "Shorts" chip in Search */
yt-chip-cloud-chip-renderer:has(yt-formatted-string[title="Shorts"]) {
display: none !important;
}
/* Shorts in search results */
ytd-video-renderer:has(a[href^="/shorts"]) {
display: none !important;
}
}
@supports not selector(:has(*)) {
/* In Firefox < 121 we just hide the second chip in Search */
ytd-search iron-selector[id="chips"] yt-chip-cloud-chip-renderer:nth-child(2) {
display: none !important;
}
/* Can't hide Shorts in search results in Firefox < 121 with just CSS ;_; */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment