// ==UserScript== // @name 华医网自动切换下一课 // @namespace https://91huayi.com/ // @version 3.1.3 // @description 华医网cme1.91huayi.com 全自动播放、静音、下一课,无界面纯后台 // @author auto // @match https://cme1.91huayi.com/cme/* // @match https://cme1.91huayi.com/* // @match *://*.91huayi.com/* // @grant none // @run-at document-end // ==/UserScript== (function() { 'use strict'; // 延迟启动,保证页面加载完整 setTimeout(() => { console.log('✅ 华医网全自动脚本已后台运行'); startAutoTask(); }, 2000); function startAutoTask() { setInterval(() => { // 1. 自动静音 + 自动播放 const videos = document.querySelectorAll('video'); videos.forEach(v => { v.muted = true; if (v.paused && v.duration > 0) { v.play().catch(err => {}); } }); // 2. 自动关闭所有弹窗 const closeBtns = document.querySelectorAll( '.close, .btn-close, [class*="close"], [id*="close"], button:contains("确定"), button:contains("知道了")' ); closeBtns.forEach(btn => { if (btn.offsetParent !== null) { btn.click(); } }); // 3. 视频播完 → 自动下一课 videos.forEach(v => { if (v.duration > 0 && v.currentTime / v.duration >= 0.97) { setTimeout(goNextLesson, 1500); } }); }, 800); } // 自动寻找并点击下一课 function goNextLesson() { const nextSelectors = [ '.next', '.btn-next', '.next-lesson', '.next-item', 'button:contains("下一课")', 'button:contains("下一步")', 'button:contains("继续学习")', '[class*="next"]:not(.disabled)', '.course-item:not(.finished) .title', '.lesson-item:not(.played) .name' ]; for (const selector of nextSelectors) { const elements = document.querySelectorAll(selector); for (const el of elements) { if (el.offsetParent !== null) { el.click(); return; } } } } })();