YouTube Customizer

Personnalise l'apparence de YouTube (couleurs, éléments cachés, etc.)

2025-10-24 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/553579/1683158/YouTube%20Customizer.js

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         YouTube Customizer
// @namespace    https://greasyfork.org/users/ton-nom
// @version      1.0
// @description  Personnalise l'apparence de YouTube (couleurs, éléments cachés, etc.)
// @author       TonNom
// @match        https://www.youtube.com/*
// @icon         https://www.youtube.com/s/desktop/5a8c2c6f/img/favicon_32x32.png
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // 🎨 Thème personnalisé
    GM_addStyle(`
        body {
            background-color: #0f0f0f !important;
            color: #eee !important;
        }
        #masthead {
            background-color: #202020 !important;
        }
        a, ytd-thumbnail, ytd-video-renderer {
            border-radius: 10px !important;
        }
    `);

    // 🚫 Cacher les shorts
    function hideShorts() {
        const shorts = document.querySelectorAll('ytd-rich-section-renderer, ytd-reel-shelf-renderer');
        shorts.forEach(el => el.style.display = 'none');
    }

    // 👁️ Ajouter un bouton pour activer/désactiver le mode minimaliste
    function addMinimalButton() {
        if (document.querySelector('#minimalButton')) return;

        const btn = document.createElement('button');
        btn.id = 'minimalButton';
        btn.innerText = '🧘 Mode minimaliste';
        Object.assign(btn.style, {
            position: 'fixed',
            top: '80px',
            right: '20px',
            zIndex: '9999',
            background: '#ff0000',
            color: 'white',
            border: 'none',
            padding: '8px 12px',
            borderRadius: '8px',
            cursor: 'pointer',
        });

        let active = false;
        btn.onclick = () => {
            active = !active;
            document.querySelector('#secondary')?.style.setProperty('display', active ? 'none' : '');
            document.querySelector('#comments')?.style.setProperty('display', active ? 'none' : '');
            btn.style.background = active ? '#22bb33' : '#ff0000';
        };

        document.body.appendChild(btn);
    }

    // Exécution
    const observer = new MutationObserver(() => {
        hideShorts();
        addMinimalButton();
    });
    observer.observe(document.body, { childList: true, subtree: true });

})();