YouTube Shorts Ultimate Cleaner

Hide all UI elements in YouTube Shorts

目前為 2025-04-10 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         YouTube Shorts Ultimate Cleaner
// @namespace    http://tampermonkey.net/
// @version      4.0
// @description  Hide all UI elements in YouTube Shorts
// @author       AShayeb
// @match        *://*.youtube.com/shorts/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const elementsToHide = {
        channelName: 'a.yt-core-attributed-string__link[href*="/@"]', // اسم القناة
        subscribeButton: '.yt-spec-touch-feedback-shape, ytd-subscribe-button-renderer, yt-button-renderer[id="subscribe-button"], button[aria-label*="Subscribe"], button[aria-label*="اشتراك"], .ytd-subscribe-button-renderer', // أيقونة الاشتراك - محدثة
        titles: 'h2.ytShortsVideoTitleViewModelShortsVideoTitle',
        hashtags: 'a[href*="/hashtag/"]',
        metadata: '#metadata, #description',
        // إضافة عنصر جديد لإخفاء معلومات الموسيقى/الصوت
        musicInfo: '.ytReelSoundMetadataViewModelMarqueeContainer, marquee-scroll, .ytMarqueeScrollHost, .ytMarqueeScrollInnerContainer, .ytMarqueeScrollPrimaryString'
    };

    const nuclearClean = () => {
        // إخفاء العناصر الأساسية
        Object.values(elementsToHide).forEach(selector => {
            document.querySelectorAll(selector).forEach(el => {
                el.style.cssText = 'display: none !important; opacity: 0 !important; height: 0 !important;';
                // لا نقوم بإزالة العناصر لتجنب مشاكل التخطيط
                // el.remove(); - تم تعليق هذا السطر
            });
        });

        // تنظيف إضافي للعناصر الديناميكية
        document.querySelectorAll('[class*="subscribe"], [class*="button"], [aria-label*="Subscribe"], [aria-label*="اشتراك"]').forEach(btn => {
            if(btn.innerText.includes('اشتراك') ||
               btn.innerText.includes('Subscribe') ||
               btn.getAttribute('aria-label')?.includes('اشتراك') ||
               btn.getAttribute('aria-label')?.includes('Subscribe')) {
                btn.style.cssText = 'display: none !important; opacity: 0 !important; height: 0 !important;';
            }
        });

        // إخفاء حاويات زر الاشتراك
        document.querySelectorAll('#subscribe-button, .ytd-subscribe-button-renderer, ytd-button-renderer').forEach(container => {
            if (container.querySelector('[aria-label*="Subscribe"], [aria-label*="اشتراك"]') ||
                container.textContent.includes('Subscribe') ||
                container.textContent.includes('اشتراك')) {
                container.style.cssText = 'display: none !important; opacity: 0 !important; height: 0 !important;';
            }
        });

        // إخفاء إضافي لمعلومات الموسيقى (العنصر في المربع الأحمر)
        document.querySelectorAll('[class*="sound"], [class*="music"], [class*="audio"], [class*="Marquee"]').forEach(el => {
            el.style.cssText = 'display: none !important; opacity: 0 !important; height: 0 !important;';
        });
    };

    // مراقبة مكثفة للتغييرات
    const observer = new MutationObserver(mutations => {
        mutations.forEach(({ addedNodes, attributeName }) => {
            if(attributeName === 'class' || addedNodes.length) nuclearClean();
        });
    });

    // بدء المراقبة الشاملة
    observer.observe(document.body, {
        childList: true,
        subtree: true,
        attributes: true,
        characterData: true,
        attributeFilter: ['class', 'href', 'style']
    });

    // تشغيل مباشر مع تكرار مكثف
    nuclearClean();
    setInterval(nuclearClean, 250);
    window.addEventListener('scroll', nuclearClean);
    document.addEventListener('yt-navigate-finish', nuclearClean);
})();