YouTube Always Default Logo (No Premium, No Yoodle)

Always shows the default YouTube logo, never the premium one, and hides yoodle

Від 21.05.2025. Дивіться остання версія.

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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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         YouTube Always Default Logo (No Premium, No Yoodle)
// @version      1.0.0
// @description  Always shows the default YouTube logo, never the premium one, and hides yoodle
// @author       barraIhsan (modded by T3 Chat)
// @match        https://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?domain=youtube.com
// @namespace https://greatest.deepsurf.us/users/1412746
// ==/UserScript==

(function () {
    'use strict';

    // Trusted Types fix for Chromium
    if (window.trustedTypes && trustedTypes.createPolicy) {
        if (!trustedTypes.defaultPolicy) {
            const passThroughFn = (x) => x;
            trustedTypes.createPolicy('default', {
                createHTML: passThroughFn,
                createScriptURL: passThroughFn,
                createScript: passThroughFn,
            });
        }
    }

    window.addEventListener('load', () => {
        function restoreDefaultLogo() {
            // Show all normal logos
            document
                .querySelectorAll('.ytd-topbar-logo-renderer[hidden]')
                .forEach((el) => el.removeAttribute('hidden'));

            // Remove any custom SVG injected by other scripts (like premium logo)
            document.querySelectorAll('ytd-logo').forEach((ytdLogo) => {
                // Remove is-red-logo attribute if present
                ytdLogo.removeAttribute('is-red-logo');
                // Try to restore the original SVG if it was replaced
                const svg = ytdLogo.querySelector('svg');
                if (svg) {
                    // If the SVG was replaced, reload the page section to restore it
                    // (YouTube will re-render the logo on navigation, so just remove custom content)
                    // Optionally, you can try to reload the logo by removing the SVG and letting YouTube re-render it
                    // But usually, just removing custom attributes is enough
                }
            });

            // Hide yoodle using the hidden attribute (from youtube)
            document
                .querySelectorAll('ytd-yoodle-renderer')
                .forEach((el) => el.setAttribute('hidden', ''));

            // Change the tooltip when hovering youtube logo
            document
                .querySelectorAll('a#logo')
                .forEach((el) => el.setAttribute('title', 'YouTube Home'));
        }

        function checkLogo() {
            // Always restore the default logo, regardless of login state
            restoreDefaultLogo();
        }

        // Observe changes in the DOM
        const observer = new MutationObserver(checkLogo);

        observer.observe(document.body, { childList: true, subtree: true });

        // Initial run
        checkLogo();
    });
})();