您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide YouTube Shorts everywhere and redirect shorts URLs to normal watch pages.
// ==UserScript== // @name Block + Redirect YouTube Shorts // @namespace http://github.com/chunjee // @version 0.1.0 // @description Hide YouTube Shorts everywhere and redirect shorts URLs to normal watch pages. // @author Chunjee // @match https://www.youtube.com/* // @grant none // @run-at document-start // @license MIT // ==/UserScript== (function() { 'use strict'; // 🚫 Redirect if on a Shorts URL if (location.pathname.startsWith('/shorts/')) { location.replace('https://www.youtube.com/'); return; } // 🧹 Hide Shorts previews everywhere else const observer = new MutationObserver(() => { document.querySelectorAll('a[href*="/shorts/"]').forEach(link => { let container = link.closest( 'ytd-grid-video-renderer, ytd-rich-item-renderer, ytd-video-renderer, ytd-compact-video-renderer, ytd-reel-shelf-renderer, ytd-rich-grid-media' ); if (!container) container = link; container.style.display = 'none'; }); }); observer.observe(document, { childList: true, subtree: true }); })();