您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Modify YouTube's UI to look like older versions, similar to Rehike
当前为
// ==UserScript== // @name Rehike for YouTube (Userscript) // @namespace https://gf.zukizuki.org/en/users/your-username // @version 1.0 // @description Modify YouTube's UI to look like older versions, similar to Rehike // @author Your Name // @match *://www.youtube.com/* // @icon https://www.youtube.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_addStyle // @run-at document-start // ==/UserScript== (function() { 'use strict'; console.log("[Rehike Userscript] Loaded."); // Apply basic UI modifications function modifyYouTubeUI() { GM_addStyle(` #masthead-container { background-color: #222 !important; } ytd-searchbox { background-color: #333 !important; } ytd-app { background-color: #181818 !important; } /* Hide YouTube Shorts */ ytd-rich-section-renderer { display: none !important; } `); } // Intercept API Calls to modify JSON data function interceptAPI() { const open = window.XMLHttpRequest.prototype.open; window.XMLHttpRequest.prototype.open = function(method, url) { if (url.includes("browse") || url.includes("next")) { this.addEventListener("readystatechange", function() { if (this.readyState === 4 && this.responseText) { try { let response = JSON.parse(this.responseText); // Modify response to remove Shorts (example) if (response.contents) { response.contents = response.contents.filter( content => !content.id.includes("shorts") ); } Object.defineProperty(this, "responseText", { get: () => JSON.stringify(response) }); } catch (e) { console.error("[Rehike Userscript] API Intercept Error:", e); } } }); } return open.apply(this, arguments); }; } // Run modifications function init() { modifyYouTubeUI(); interceptAPI(); } // Check when YouTube loads and run script let observer = new MutationObserver((mutations, obs) => { if (document.querySelector("ytd-app")) { obs.disconnect(); init(); } }); observer.observe(document, { childList: true, subtree: true }); })();