YouTube Unshortened (More Robust)

Hides YouTube Shorts from feeds, but keeps the main Shorts navigation link.

Versión del día 12/10/2025. Echa un vistazo a la versión más reciente.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name         YouTube Unshortened (More Robust)
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Hides YouTube Shorts from feeds, but keeps the main Shorts navigation link.
// @author       OthorWight
// @match        *://www.youtube.com/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const hideShortsElements = () => {
        // Selectors for Shorts-related elements, EXCLUDING the main navigation links.
        const selectorsToHide = [
            // --- Shelves and Sections ---
            // Hide the entire "Shorts" section (shelf container) on Home/Subscriptions pages.
            'ytd-rich-section-renderer:has(ytd-rich-shelf-renderer[is-shorts])',
            // Explicitly hide the rich shelf renderer if it has the 'is-shorts' attribute.
            'ytd-rich-shelf-renderer[is-shorts]',

            // Hide other types of Shorts shelves (e.g., on search results).
            'ytd-reel-shelf-renderer',

            // --- Individual Videos ---
            // Hide individual Short videos that may appear in various feeds.
            'ytd-grid-video-renderer:has(a[href^="/shorts/"])', // Grid view (e.g., Subscriptions)
            'ytd-rich-item-renderer:has(a[href^="/shorts/"])', // Home page rich grid
            'ytd-video-renderer:has(a[href^="/shorts/"])', // List view (e.g., Search results)
            'ytd-compact-video-renderer:has(a[href^="/shorts/"])', // "Up next" sidebar when watching a video
            'ytd-reel-item-renderer' // Renderer specifically for Shorts reels
        ];

        // Find all elements matching the selectors and hide them.
        document.querySelectorAll(selectorsToHide.join(','))
            .forEach(element => {
                if (element.style.display !== 'none') {
                    element.style.display = 'none';
                }
            });

        // --- Special Case: Channel Tabs ---
        // Hiding the "Shorts" tab on a channel page.
        document.querySelectorAll('tp-yt-paper-tab').forEach(tab => {
            const tabText = tab.textContent || tab.innerText;
            if (tabText && tabText.trim().toUpperCase() === 'SHORTS') {
                 if (tab.style.display !== 'none') {
                    tab.style.display = 'none';
                }
            }
        });
    };

    // YouTube loads content dynamically. A MutationObserver is the most
    // reliable way to act on new elements as they are added to the page.
    const observer = new MutationObserver(hideShortsElements);

    // Start observing the entire document for additions of new elements.
    observer.observe(document.documentElement, {
        childList: true,
        subtree: true
    });

    // Run the function once the initial document is loaded.
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', hideShortsElements);
    } else {
        hideShortsElements();
    }
})();