Youtube grayscale all but video itself

grayscale all but video itself

  1. // ==UserScript==
  2. // @name Youtube grayscale all but video itself
  3. // @namespace https://greasyfork.org/users/821661
  4. // @match https://www.youtube.com/*
  5. // @grant none
  6. // @run-at document-start
  7. // @version 0.2
  8. // @author hdyzen
  9. // @description grayscale all but video itself
  10. // ==/UserScript==
  11. 'use strict';
  12.  
  13. const SHEET = new CSSStyleSheet();
  14.  
  15. const GRAYSCALE_FACTOR = 0.8;
  16. const SATURATE_FACTOR = 0.4;
  17.  
  18. const RULES = `
  19. yt-guide-manager, yt-mdx-manager, yt-playlist-manager, yt-hotkey-manager, #video-preview, #masthead-container, tp-yt-app-drawer, #ytd-browse, #secondary.ytd-watch-flexy, #below.ytd-watch-flexy, #movie_player > :not(.html5-video-container, #ytp-caption-window-container), ytd-browse {
  20. filter: grayscale(${GRAYSCALE_FACTOR}) saturate(${SATURATE_FACTOR}) !important;
  21. }
  22. `;
  23.  
  24. SHEET.replaceSync(RULES);
  25.  
  26. document.adoptedStyleSheets = [SHEET, ...document.adoptedStyleSheets];