您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
autostart video + skip intro/outro
// ==UserScript== // @name Sprinter // @author _Aldan_ // @namespace http://tampermonkey.net/ // @version 2.2 // @description autostart video + skip intro/outro // @match https://jut.su/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let wasPlayClicked = false; window.addEventListener('load', () => { const pb = document.querySelector('button.vjs-big-play-button'); if (pb && !wasPlayClicked) { pb.click(); wasPlayClicked = true; } }); const tasks = new WeakMap(); function scheduleClick(el) { if (!el.classList.contains('vjs-hidden')) { if (!tasks.has(el)) { const timer = setTimeout(() => { el.click(); tasks.delete(el); }, 2000); tasks.set(el, timer); } } else if (tasks.has(el)) { clearTimeout(tasks.get(el)); tasks.delete(el); } } const observer = new MutationObserver(mutations => { for (const mutation of mutations) { if (mutation.type === 'attributes' && mutation.attributeName === 'class') { const t = mutation.target; if ( t.matches('div.vjs-overlay-skip-intro') || ( t.matches('div.vjs-overlay') && (/пропустить заставку/i.test(t.textContent) || /следующая серия/i.test(t.textContent)) ) ) { scheduleClick(t); } } } }); observer.observe(document.body, { attributes: true, subtree: true }); function init() { const els = document.querySelectorAll('div.vjs-overlay-skip-intro, div.vjs-overlay'); els.forEach(el => { if ( el.matches('div.vjs-overlay-skip-intro') || /пропустить заставку/i.test(el.textContent) || /следующая серия/i.test(el.textContent) ) { scheduleClick(el); } }); } window.addEventListener('load', init); })();