YouTube Player Customizer (CSS)

Красные плашки HD, скрытие подсказок и фикс текста в плеере YouTube

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         YouTube Player Customizer (CSS)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Красные плашки HD, скрытие подсказок и фикс текста в плеере YouTube
// @author       Я
// @match        *://*.youtube.com/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Сюда помещаем весь ваш CSS-код
    const css = `
        /* 1. Возвращает красную мини-плашку HD / 4K / 8K на самой кнопке шестеренки */
        .ytp-settings-button.ytp-hd-quality-badge::after,
        .ytp-settings-button.ytp-4k-quality-badge::after,
        .ytp-settings-button.ytp-5k-quality-badge::after,
        .ytp-settings-button.ytp-8k-quality-badge::after {
            background-color: #FF0000 !important;
        }

        /* 2. Делает красными подписи "HD", "4K" рядом с цифрами (1080p, 1440p) внутри меню */
        .ytp-panel-menu .ytp-menuitem .ytp-panel-menu .ytp-menuitem sup,
        .ytp-swatch-color {
            color: #FF0000 !important;
        }

        /* Скрывает подсказку "Проведите вверх..." над превью */
        .ytp-tooltip.ytp-preview:not([style*="display: none"]) .ytp-precise-seeking-hint {
            display: none !important;
        }

        .ytp-tooltip-edu {
            display: none !important;
        }

        /* Разрешаем контейнеру (pill) растягиваться под размер текста */
        .ytp-tooltip-progress-bar-pill {
            max-width: max-content !important;
            width: max-content !important;
            padding-right: 8px !important; /* Добавляем небольшой отступ справа для красоты */
        }

        /* Отключаем многоточие и скрытие текста */
        .ytp-tooltip-progress-bar-pill-title {
            overflow: visible !important;
            text-overflow: clip !important;
            white-space: nowrap !important;
            display: block !important;
        }
    `;

    // Функция для внедрения стилей на страницу
    function injectStyles(cssString) {
        const style = document.createElement('style');
        style.type = 'text/css';
        style.textContent = cssString;
        
        // Вставляем стили как можно раньше (в <head> или <html>)
        if (document.head) {
            document.head.appendChild(style);
        } else {
            document.documentElement.appendChild(style);
        }
    }

    // Запускаем внедрение
    injectStyles(css);
})();