Удалить YouTube Shorts

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

目前为 2024-12-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         Удалить YouTube Shorts
// @namespace    http://tampermonkey.net/
// @version      1.0
// @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 => {
            if (tab.innerText.includes("Shorts")) tab.remove();
        });

        document.querySelectorAll('ytd-rich-grid-media, ytd-grid-video-renderer').forEach(video => {
            if (video.querySelector('ytd-thumbnail-overlay-time-status-renderer')?.innerText.includes("Short")) video.remove();
        });

        document.querySelectorAll('ytd-rich-shelf-renderer').forEach(section => {
            if (section.querySelector('#title')?.innerText.includes("Shorts")) section.remove();
        });
    };

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

})();

QingJ © 2025

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