您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hides/blocks/blacklists specific YouTube channel elements on the homepage
// ==UserScript== // @name Hide Specific YouTube Channels // @namespace Pain // @version 1.0 // @author Pain // @description Hides/blocks/blacklists specific YouTube channel elements on the homepage // @match https://www.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to hide unwanted elements function hideElements() { // Select elements based on their titles or other attributes const channelsToHide = [ // Enter channel names here "channelToHide 1", "channelToHide 2", ]; // Loop through each channel name and hide corresponding elements channelsToHide.forEach(channelName => { // Create a selector to find elements with the title attribute containing the channel name const selector = `ytd-rich-item-renderer #avatar-link[title*="${channelName}"]`; const elements = document.querySelectorAll(selector); // Hide each element found elements.forEach(element => { element.closest('ytd-rich-item-renderer').style.display = 'none'; }); }); } // Initial call to hide elements hideElements(); // Mutation observer to handle dynamic content loading const observer = new MutationObserver(hideElements); observer.observe(document.body, { childList: true, subtree: true }); })();