Youtube No Flexy Mode

Disable Flexy Mode

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Youtube No Flexy Mode
// @namespace    http://tampermonkey.net/
// @version      0.50
// @description  Disable Flexy Mode
// @author       Botan
// @match        *://*.youtube.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==


// Thanks to AlexT. this fix does not longer use any intervals, it instead uses the Youtube API directly.
(function() {
    'use strict';
    if (window.top != window.self) return;
    console.log('Youtube No Flexy Mode');

    // Disables (if available) the creation of the new flexy dom.
    function disableFlexyFeature() {
        let cfg = (typeof window.ytcfg === "undefined") ? false : window.ytcfg.get("EXPERIMENT_FLAGS");
        if (!cfg || cfg.kevlar_flexy_watch_new_dom === false) return;

        cfg.kevlar_flexy_watch_new_dom = false;
        console.log('Set kevlar_flexy_watch_new_dom to false');

        cfg.kevlar_transparent_player_background = false;
        console.log('Set kevlar_transparent_player_background to false');

        window.ytcfg.set("EXPERIMENT_FLAGS", cfg);
    }

    disableFlexyFeature();
    document.addEventListener("yt-navigate-start", disableFlexyFeature, true);
})();