您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Скрывает YouTube Shorts с главной страницы и удаляет кнопку Shorts из бокового меню
// ==UserScript== // @name Hide YouTube Shorts // @name:ru Скрывает YouTube Shorts // @namespace http://tampermonkey.net/ // @version 1.2 // @description Скрывает YouTube Shorts с главной страницы и удаляет кнопку Shorts из бокового меню // @description:en Hides YouTube Shorts from the homepage and removes the Shorts button from the sidebar // @author Lesnoy_Shaman // @match https://www.youtube.com/* // @grant none // @license GPL-3.0 // ==/UserScript== (function() { 'use strict'; function hideShortsElements() { const shortsSections = document.querySelectorAll('ytd-rich-section-renderer'); shortsSections.forEach(section => { const titleElement = section.querySelector('span#title'); if (titleElement && titleElement.textContent.trim() === 'Shorts') { section.style.display = 'none'; } }); const shortsButtons = document.querySelectorAll('ytd-guide-entry-renderer'); shortsButtons.forEach(button => { const title = button.querySelector('yt-formatted-string.title'); if (title && title.textContent.trim() === 'Shorts') { button.remove(); } }); } function runWhenReady() { if (document.readyState === 'complete' || document.readyState === 'interactive') { hideShortsElements(); const observer = new MutationObserver(hideShortsElements); observer.observe(document.body, { childList: true, subtree: true }); let attemptCount = 0; const maxAttempts = 60; const intervalCheck = setInterval(() => { if (attemptCount >= maxAttempts) { clearInterval(intervalCheck); return; } hideShortsElements(); attemptCount++; }, 1000); } else { setTimeout(runWhenReady, 500); } } runWhenReady(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址