您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Plays the video
// ==UserScript== // @name Youtube Antipause (Observer Js api) // @description Plays the video // @include *://*.youtube.com/* // @version 1.03 // @namespace https://greasyfork.org/users/410526 // ==/UserScript== ( function() { 'use strict'; let movie_player_div = document.getElementById('movie_player'); let buttons=['confirm-button','action-button']; function observe_class_changes(mutationsList) { mutationsList.forEach(mutation => { if (mutation.attributeName === 'class' && movie_player_div.classList.contains('paused-mode')) { for (const button in buttons) { if (document.getElementById(buttons[button]).offsetParent !== null) { document.getElementById(buttons[button]).click(); movie_player_div.playVideo(); } } } }) }; let mutationObserver = new MutationObserver(observe_class_changes); mutationObserver.observe( movie_player_div, { attributes: true } ); })();