您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove YouTube "Video paused. Continue watching?"
// ==UserScript== // @name YouTube Don't Stop // @description Remove YouTube "Video paused. Continue watching?" // @namespace https://blog.coniy.com/?YouTubeDontStop // @match *://*.youtube.com/* // @match *://*.youtube-nocookie.com/* // @run-at document-end // @author chengxuncc // @version 1.0 // @license MIT // @grant none // ==/UserScript== 'use strict'; const lactRefreshInterval = 5 * 60 * 1000; // 5 mins const initialLactDelay = 1000; // Page Visibility API Object.defineProperties(document, { 'hidden': { value: false }, 'visibilityState': { value: 'visible' } }); window.addEventListener('visibilitychange', e => e.stopImmediatePropagation(), true); // _lact stuff function waitForYoutubeLactInit(delay = initialLactDelay) { if (window.hasOwnProperty('_lact')) { window.setInterval(() => { window._lact = Date.now(); }, lactRefreshInterval); }else{ window.setTimeout(() => waitForYoutubeLactInit(delay * 2), delay); } } waitForYoutubeLactInit(); // Hide start to play window.setTimeout(() => { window.document.getElementsByTagName("yt-bubble-hint-renderer")[0].style.display = 'none'; }, 1000); window.setTimeout(() => { window.document.getElementsByTagName("yt-bubble-hint-renderer")[0].style.display = 'none'; }, 2000);