您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirect YouTube logo to your subscription feed. Works with both free and premium.
// ==UserScript== // @name Redirect Youtube Logo to Subscriptions // @namespace https://tempermonkey.net // @description Redirect YouTube logo to your subscription feed. Works with both free and premium. // @version 1.0.0 // @include *://*.youtube.tld/* // @author CHJ85 // ==/UserScript== async function WaitForPageLoad() { while (true) { var logoLoaded = document.querySelector("a[id='logo']") !== null; var userLoggedIn = document.querySelector("div[id='buttons'] img[id='img'][alt='Avatar image']") !== null; var userLoggedOut = document.querySelector("div[id='end'] [id='button'][aria-label='Sign in']") !== null; if (logoLoaded && (userLoggedIn || userLoggedOut)) { if (userLoggedIn) { RunScript(); } return; } await new Promise(r => setTimeout(r, 100)); } } function RunScript() { var logos = document.querySelectorAll("a[id='logo']"); logos.forEach(logo => { logo.addEventListener("click", LogoClick); }); } function LogoClick(event) { event.preventDefault(); event.stopPropagation(); var subLink = document.querySelector("a[href='/feed/subscriptions']"); if (subLink) { subLink.click(); } else { console.log("[YTLTSF] Subscriptions link not found"); } } WaitForPageLoad();