Удалить YouTube Shorts

Удаляет шортсы просто но эффективно

// ==UserScript==
// @name         Удалить YouTube Shorts
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Удаляет шортсы просто но эффективно
// @author       Kenseori
// @match        *://www.youtube.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const removeShorts = () => {
        document.querySelectorAll('ytd-mini-guide-entry-renderer').forEach(tab => tab.innerText.includes("Shorts") && tab.remove());
        document.querySelectorAll('ytd-rich-grid-media, ytd-grid-video-renderer').forEach(video => video.querySelector('ytd-thumbnail-overlay-time-status-renderer')?.innerText.includes("Short") && video.remove());
        document.querySelectorAll('ytd-rich-shelf-renderer').forEach(section => section.querySelector('#title')?.innerText.includes("Shorts") && section.remove());
        document.querySelectorAll('ytd-reel-shelf-renderer').forEach(reel => reel.querySelector('#title-container')?.innerText.includes("Shorts") && reel.remove());
        document.querySelectorAll('a#endpoint').forEach(link => link.getAttribute('title') === "Shorts" && link.remove());
    };

    window.addEventListener('load', removeShorts);
    new MutationObserver(removeShorts).observe(document.body, { childList: true, subtree: true });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址