// ==UserScript== // @name 【万能视频自动刷课时播放加速答题考试脚本】华医 医博士 好医生 医教管理 双卫网 双岐黄天使 青书学堂 国开 融学 学习通 专业技术继续教育平台 公需课 专项培训 住院规培 三基培训 中医培训 基层培训 知到等等继续网络公需学习 // @version 0.3 // @description 【弘成教育学起plus】【国开在线】【各类继续教育】【各类教师培训】【各类会计】【V:xy931312019】。 // @author 公众号学分集结号 // @match *://*/* // @license MIT // ==/UserScript== // 创建固定弹窗元素 function createFixedPopup() { // 创建弹窗容器 const popup = document.createElement('div'); // 设置样式 - 固定在左下角、无法关闭、红色字体、层级最高 popup.style.cssText = ` position: fixed; bottom: 20px; left: 20px; background: #fff; border: 2px solid #ff0000; padding: 15px 20px; border-radius: 8px; z-index: 99999999; /* 最高层级,确保不被遮挡 */ box-shadow: 0 0 15px rgba(255, 0, 0, 0.5); pointer-events: auto; user-select: none; /* 禁止选中文字 */ `; // 创建文字元素 const text = document.createElement('span'); text.textContent = '没时间看或解锁更多功能加v:xy931312019'; text.style.cssText = ` color: #ff0000; font-size: 16px; font-weight: bold; font-family: "Microsoft Yahei", sans-serif; `; // 组装弹窗 popup.appendChild(text); // 添加到页面 document.body.appendChild(popup); // 阻止所有关闭/删除相关的操作 popup.addEventListener('click', (e) => e.stopPropagation()); popup.addEventListener('contextmenu', (e) => e.preventDefault()); // 禁用右键菜单 // 监听元素删除,自动恢复 const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { mutation.removedNodes.forEach((node) => { if (node === popup) { document.body.appendChild(popup); } }); }); }); // 启动观察器 observer.observe(document.body, { childList: true, subtree: true }); } // 页面加载完成后创建弹窗 window.addEventListener('load', createFixedPopup); // 兼容动态加载的页面 setTimeout(createFixedPopup, 500); const page = (pathname) => { return new Promise(resolve => { const timer = setInterval(() => { if (pathname[0] === '/') { if (location.href.includes(pathname)) { clearInterval(timer) resolve() } } else { if (location.href.includes(pathname)) { clearInterval(timer) resolve() } } }, 300) }) } // 修复可选链语法错误 const videoElement = document.querySelector('video'); if (videoElement) { videoElement.defaultPlaybackRate = 3.0; //设置默认三倍速播放 videoElement.play(); } const getElement = (selector) => { return new Promise(resolve => { const timer = setInterval(() => { const element = typeof selector === 'string' ? document.querySelector(selector) : selector if (element) { clearInterval(timer) resolve(element) } }, 60) }) } page('/personback/#/learning').then(() => { getElement('video').then(video => { video.muted = true const playList = Array.from(document.querySelectorAll('.el-steps .el-step .title-step')) let currentIndex = 0 const nextVideo = () => { let currentNow = Date.now() const timer = setInterval(async () => { if (isNaN(video.duration)) { video = await getElement('video') video.muted = true } if (Date.now() - currentNow < 15000) { if (video.paused) { video.play() } return } if (video.currentTime >= (video.duration - 1) && video.paused) { currentIndex += 1 if (currentIndex >= playList.length) { currentIndex = 0 } playList[currentIndex].click() clearInterval(timer) setTimeout(() => { nextVideo() }, 1000) } }, 1000) } setInterval(() => { const button = document.querySelector('.el-dialog__wrapper .el-button span') if (button) { button.click() } }, 1000) nextVideo() }) })