YouTube Player Customizer (CSS)

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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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