Remove YouTube Video End Screen Thumbnails

Remove YouTube video end screen thumbnails that cover the end of the video

  1. // ==UserScript==
  2. // @name Remove YouTube Video End Screen Thumbnails
  3. // @namespace https://www.example.com/
  4. // @version 1
  5. // @description Remove YouTube video end screen thumbnails that cover the end of the video
  6. // @author ChatGPT fr fr
  7. // @match https://www.youtube.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const observer = new MutationObserver(function(mutations) {
  16. mutations.forEach(function(mutation) {
  17. if (mutation.type === 'childList') {
  18. mutation.addedNodes.forEach(function(node) {
  19. if (node.nodeName === 'DIV' && node.classList.contains('ytp-ce-element')) {
  20. node.remove();
  21. }
  22. });
  23. }
  24. });
  25. });
  26.  
  27. observer.observe(document.body, { childList: true, subtree: true });
  28.  
  29. const style = document.createElement('style');
  30. style.type = 'text/css';
  31. style.innerHTML = `
  32. .ytp-ce-covering-overlay,
  33. .ytp-ce-element-shadow,
  34. .ytp-ce-covering-image,
  35. .ytp-ce-expanding-image,
  36. .ytp-ce-element.ytp-ce-video.ytp-ce-element-show,
  37. .ytp-ce-element.ytp-ce-channel.ytp-ce-channel-this,
  38. .ytp-ce-element-overlay {
  39. display: none !important;
  40. visibility: hidden !important;
  41. }
  42. `;
  43.  
  44. document.head.appendChild(style);
  45.  
  46. })();