Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created February 26, 2020 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csharpforevermore/defda6cac52080110b7fce102181112b to your computer and use it in GitHub Desktop.
Save csharpforevermore/defda6cac52080110b7fce102181112b to your computer and use it in GitHub Desktop.
Hide watched YouTube videos
// example data
var selector = '.ytd-thumbnail-overlay-resume-playback-renderer'; // CSS selector for red bar indicating video has been watched
var exampleUrl = 'https://www.youtube.com/channel/UCN64HIrZNqFQYZ2BuyY-4zg'; // example URL for text
var jQueryInjectorExtension = 'https://chrome.google.com/webstore/detail/jquery-injector/ekkjohcjbjcjjifokpingdbdlfekjcgi?hl=en'; // url for chrome extension to inject jQuery into page for code below to run
$(selector)
.parent() // ytd-thumbnail-overlay-resume-playback-renderer.style-scope.ytd-thumbnail
.parent() // div#overlays.style-scope.ytd-thumbnail
.parent() // a#thumbnail.yt-simple-endpoint.inline-block.style-scope.ytd-thumbnail
.parent() // ytd-thumbnail.style-scope.ytd-grid-video-renderer
.parent() // div#dismissable.style-scope.ytd-grid-video-renderer
.parent() // ytd-grid-video-renderer.style-scope.yt-horizontal-list-renderer
.hide();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment