// ==UserScript== // @name 天津市专业技术人员继续教育网(自动播放+解除光标限制) // @namespace http://tampermonkey.net/ // @version 0.1 // @description 天津市专业技术人员继续教育网 1.自动播放+解除光标限制 2.代码里有倍速和拖动进度条功能,取消注释即可使用,不推荐,会报错 // @author zzzaaa // @match *://*.chinahrt.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=chinahrt.com // @grant none // @run-at document-start // @license GNU GPLv3 // @downloadURL none // ==/UserScript== (function() { window.beforeInterval = setInterval(function() { attrset.ifPauseBlur = false;//解除光标限制 attrset.autoPlay = 1; //attrset.playbackRate = true;//开启倍速 //attrset.allowPlayRate = true;//开启倍速 //attrset.ifCanDrag = true;//拖动进度条 }, 50); // 延迟后覆盖 check 函数 window.endInterval = setTimeout(function() { clearInterval(window.beforeInterval); //覆盖 check() 函数 window.check = function() { console.log('check执行了'); }; console.log('check function overridden after 10 seconds'); clearInterval(window.endInterval); }, 5000); window.anyInterval = setInterval(function() { console.log(attrset) }, 1000); //自动播放 const observer = new MutationObserver(function(mutationsList) { const videoElement = document.querySelector('video'); if (videoElement) { videoElement.muted = true; videoElement.play().catch((error) => { console.error('Error playing video:', error); }); observer.disconnect(); // 找到视频并播放后,停止观察 } else { console.error('Video element not found'); } }); observer.observe(document.body, { childList: true, subtree: true }); })();