您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hides Shorts sections on YouTube
// ==UserScript== // @name Hide YouTube Shorts // @namespace http://tampermonkey.net/ // @version 0.1 // @description Hides Shorts sections on YouTube // @author iairu // @match https://*.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const hideShorts = () => { [...document.querySelectorAll("h2")] .filter(h2 => h2.innerText.includes("Shorts")) .forEach(shortsHeading => {shortsHeading.parentElement.parentElement.style.display = "none"}); }; // Handle initial page load hideShorts(); // Handle navigation via History API const originalPushState = history.pushState; const originalReplaceState = history.replaceState; history.pushState = function() { originalPushState.apply(this, arguments); setTimeout(hideShorts, 75); }; history.replaceState = function() { originalReplaceState.apply(this, arguments); setTimeout(hideShorts, 75); }; // Handle navigation via popstate event window.addEventListener('popstate', () => { setTimeout(hideShorts, 75); }); // Create mutation observer to detect DOM changes const observer = new MutationObserver((mutations) => { hideShorts(); }); // Start observing the document with configured parameters observer.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址