您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在 YouTube 和 YouTube Music 上自动点击“Video paused. Continue watching? Yes”按钮,防止视频/音乐因久未操作而暂停。
// ==UserScript== // @name Disable Auto pause YT and YT MUSIC // @namespace https://github.com/yourname // @icon https://www.youtube.com/img/favicon_48.png // @version 1.1 // @description 在 YouTube 和 YouTube Music 上自动点击“Video paused. Continue watching? Yes”按钮,防止视频/音乐因久未操作而暂停。 // @author YourName // @match *://www.youtube.com/watch* // @match *://music.youtube.com/* // @grant none // ==/UserScript== (function() { 'use strict'; console.log('[AutoContinue] Script loaded'); function clickYT() { const btn = document.querySelector('.ytp-keep-playing-button.ytp-button'); if (btn) { console.log('[AutoContinue] Clicked YouTube continue'); btn.click(); } } function clickYTMusic() { document.querySelectorAll('ytmusic-you-there-renderer button').forEach(btn => { if (/yes/i.test(btn.innerText.trim())) { console.log('[AutoContinue] Clicked YT Music continue'); btn.click(); } }); } function checkContinue() { clickYT(); clickYTMusic(); } const observer = new MutationObserver(checkContinue); observer.observe(document.body, {childList: true, subtree: true}); setInterval(checkContinue, 3000); document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'hidden' || document.visibilityState === 'visible') { console.log('[AutoContinue] Visibility changed → ' + document.visibilityState); checkContinue(); } }); })();