YouTube Player Customizer (CSS)

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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);
})();