// ==UserScript== // @name 培训弹窗自动关闭+隐藏进度条 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 自动关闭【此处还未播放,禁止拖动】弹窗,隐藏进度条防止误触发 // @match https://learn.sxycpc.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // 持续监控页面元素 const observer = new MutationObserver(()=>{ // 1. 自动点击弹窗确定按钮 document.querySelectorAll('div').forEach(el=>{ if(el.innerText.includes('此处还未播放,禁止拖动')){ const confirmBtn = el.querySelector('button'); if(confirmBtn) confirmBtn.click(); } }); // 2. 隐藏播放器进度条(根据页面适配,拦截鼠标拖拽源头) const progressBar = document.querySelector('.video-progress,.vjs-progress-control'); if(progressBar) progressBar.style.display = 'none'; }); observer.observe(document.body, {childList:true,subtree:true}); })();