Fix Oversized playbar in Youtube Theater Mode

Fix the big playbar if you have it.

Ajankohdalta 6.9.2025. Katso uusin versio.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Fix Oversized playbar in Youtube Theater Mode
// @namespace    http://tampermonkey.net/
// @version      0.1
// @license MIT
// @description  Fix the big playbar if you have it.
// @author       re11ding
// @run-at       document-start
// @match        https://www.youtube.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// ==/UserScript==

(function() {
    const removeImproperClasses = () => {
      $("div.ytp-hide-info-bar").removeClass("ytp-big-mode");
      $("div.ytp-popup").removeClass("ytp-big-mode");
    };

    var applyCSSStyle = function() {
        var style = document.createElement('style');
        style.setAttribute('media', 'screen');
        style.appendChild(document.createTextNode(''));
        document.head.appendChild(style);
        style.sheet.insertRule('.ytp-volume-slider-active .ytp-volume-panel {width: 72px !important;}');
    }
    var fixPlaybar = function() {
        const mutationObserver = new MutationObserver(removeImproperClasses);
        mutationObserver.observe(document, { subtree: true, childList: true });
    }
    var checkElementThenRun = function(selector, func) {
        var el = document.querySelector(selector);
        if ( el == null ) {
            if (window.requestAnimationFrame != undefined) {
                window.requestAnimationFrame(function(){ checkElementThenRun(selector, func)});
            } else {
                document.addEventListener('readystatechange', function(e) {
                    if (document.readyState == 'complete') {
                        func();
                    }
                });
            }
        } else {
            func();
        }
    }
    checkElementThenRun('head', applyCSSStyle);
    checkElementThenRun('#player', fixPlaybar);
})();