您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动静音视频,模拟视频播放结束
当前为
// ==UserScript== // @name 2024暑假研修,点击播放就通过 // @namespace http://tampermonkey.net/ // @version 0.3 // @license V+Adxm0001 // @description 自动静音视频,模拟视频播放结束 // @author 安得闲门 // @match https://basic.smartedu.cn/* // @match https://www.smartedu.cn/* // @match https://teacher.vocational.smartedu.cn/* // @match https://core.teacher.vocational.smartedu.cn/* // ==/UserScript== (function() { 'use strict'; setInterval(function() { var v = document.getElementsByTagName('video')[0]; if (v) { v.currentTime = v.duration; } }, 1000); function runCodeInPage(code) { var script = document.createElement('script'); script.textContent = code; (document.head || document.documentElement).appendChild(script); // 由于在插入文档后立即执行并移除,这里无需手动调用remove方法 // script.remove(); } document.addEventListener('click', function(event) { if (event.button === 0) { setTimeout(function() { runCodeInPage(` var videoElement = document.querySelector("video"); if (videoElement) { videoElement.dispatchEvent(new Event("ended")); videoElement.muted = true; videoElement.playbackRate = 1.8; videoElement.play(); } `); }, 200); } }); })();