Skip to content

Instantly share code, notes, and snippets.

@gidoBOSSftw5731
Last active January 18, 2024 01:47
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save gidoBOSSftw5731/15721a09a8be4191baeb4c5606d1a199 to your computer and use it in GitHub Desktop.
Save gidoBOSSftw5731/15721a09a8be4191baeb4c5606d1a199 to your computer and use it in GitHub Desktop.
Block annoying Youtube elements with ublock origin/adblock plus compatible filters

These are fairly experimental and may affect performance or stop working at any time. Feel free to comment if you have any better implementations, I tried to be both as specific as possible and follow reccomendation from the documentation, though I am just a guy.

The files are (at time of writing) are .ubo files (for UBlock Origin) though I dont believe this is an official file name.

All these were testing using AdNauseum, a skin of UBlock Origin.

Instructions on how to use these located here: https://www.ghacks.net/2014/10/10/how-to-add-custom-filters-to-chrome-ad-blocking-extension-%C2%B5block/ (the particular tab may be called "your filters" or "my filters")

I am not directly affiliated with UBlock Origin, AdBlock Plus, Youtube, nor their developers.

! block all playlists being reccomended underneath a video (tag me if you want one just for youtube music)
www.youtube.com##ytd-compact-playlist-renderer:has(ytd-thumbnail-overlay-side-panel-renderer)
! simillar to the more from youtube section, this is in place of the subscription box on the left side for users who are not logged in.
www.youtube.com##ytd-guide-section-renderer.ytd-guide-renderer.style-scope:has-text(/best of youtube/i)
! tv and stuff listed as "free", usually stuff like movies and/or yt originals
www.youtube.com##ytd-rich-item-renderer:has(.ytd-badge-supported-renderer:has-text(Free))
! the overlays visible when you hover over a video for watch later and add to queue
www.youtube.com###hover-overlays
! The "more from youtube" section on the expanded sidebar at the bottom
www.youtube.com##ytd-guide-section-renderer.ytd-guide-renderer.style-scope:has-text(/more from youtube/i)
! the list of categories to filter by above the video reccomendations underneath/next to a video
www.youtube.com###chips
! the banner on the home page, usually related to politics, covid 19, or other current event
www.youtube.com##.ytd-rich-section-renderer
! the "experiencing interruptions" toast popup in the bottom corner when a video is bufferring (due to network congestion, underperforming hardware, or any other reason)
www.youtube.com###toast:has(#text-container:has-text(/experiencing interruptions/i))
! block things like the youtube "my mix" and the crappy autogenerated playlists.
www.youtube.com##ytd-compact-radio-renderer:has(ytd-thumbnail-overlay-bottom-panel-renderer)
www.youtube.com##ytd-rich-item-renderer:has(ytd-thumbnail-overlay-bottom-panel-renderer)
! this blocks them also in the window after you finish a video. This does leave black squares where they were but I'd argue that's better
www.youtube.com##a.ytp-suggestion-set.ytp-videowall-still:has(.ytp-videowall-still-listlabel-mix:not(:matches-css(display: none)))
! buttons linking to youtube music (one of the worst music streaming services) on the sidebar
www.youtube.com##ytd-guide-section-renderer.ytd-guide-renderer.style-scope:nth-of-type(1) [href="https://music.youtube.com/"]
www.youtube.com###endpoint.ytd-mini-guide-entry-renderer.style-scope.yt-simple-endpoint[href="https://music.youtube.com/"]
! blue bubble popups for "new" features
www.youtube.com##tp-yt-iron-dropdown.ytd-popup-container.style-scope
! buttons linking to youtube originals on the sidebar
www.youtube.com##ytd-guide-section-renderer.ytd-guide-renderer.style-scope:nth-of-type(1) [href="/channel/UCqVDpXKLmKeBU_yyt_QkItQ"]
www.youtube.com###endpoint.ytd-mini-guide-entry-renderer.style-scope.yt-simple-endpoint[href="/channel/UCqVDpXKLmKeBU_yyt_QkItQ"]
@chellothere
Copy link

I blocked my " my mix shit playlists", but now there are white blank content blocks, how do block them?

@gidoBOSSftw5731
Copy link
Author

gidoBOSSftw5731 commented Apr 1, 2023

I blocked my " my mix shit playlists", but now there are white blank content blocks, how do block them?

@chellothere To be blunt, there likely isn't a good way to. Maybe it could be fixed by selecting the parent element (and I can probably test that soon,) but it's likely that that's the alternative you get, unless you want to make a plugin which re-parses the entire page and grid into something you can remove items from

@chellothere
Copy link

Ok, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment