Youtube No Flexy Mode

Disable Flexy Mode

  1. // ==UserScript==
  2. // @name Youtube No Flexy Mode
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.50
  5. // @description Disable Flexy Mode
  6. // @author Botan
  7. // @match *://*.youtube.com/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12.  
  13. // Thanks to AlexT. this fix does not longer use any intervals, it instead uses the Youtube API directly.
  14. (function() {
  15. 'use strict';
  16. if (window.top != window.self) return;
  17. console.log('Youtube No Flexy Mode');
  18.  
  19. // Disables (if available) the creation of the new flexy dom.
  20. function disableFlexyFeature() {
  21. let cfg = (typeof window.ytcfg === "undefined") ? false : window.ytcfg.get("EXPERIMENT_FLAGS");
  22. if (!cfg || cfg.kevlar_flexy_watch_new_dom === false) return;
  23.  
  24. cfg.kevlar_flexy_watch_new_dom = false;
  25. console.log('Set kevlar_flexy_watch_new_dom to false');
  26.  
  27. cfg.kevlar_transparent_player_background = false;
  28. console.log('Set kevlar_transparent_player_background to false');
  29.  
  30. window.ytcfg.set("EXPERIMENT_FLAGS", cfg);
  31. }
  32.  
  33. disableFlexyFeature();
  34. document.addEventListener("yt-navigate-start", disableFlexyFeature, true);
  35. })();