您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Emulate mouse click on the "New to you" button
// ==UserScript== // @name e Youtube Homepage Auto Click "New to you" May 2023 // @description Emulate mouse click on the "New to you" button // @namespace ytnewtoyou // @version 1 // @match https://www.youtube.com/ // @run-at document-end // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @license public domain // ==/UserScript== (function() { console.log(`${GM.info.script.name} run`) var failsafe=0 var cl=_=>{ var c=document.querySelector('#chips') var r=document.querySelector('#right-arrow') if(c&&r){ //c.style.transform=`translateX(${c.parentNode.offsetWidth-c.offsetWidth}px)` if(failsafe<20 && r.checkVisibility()){ failsafe++ r.querySelector('button').click() setTimeout(cl,10) } if(!r.checkVisibility()) c.querySelector('[title="New to you"]').click() }else setTimeout(cl,500) } cl() })()