// ==UserScript== // @name 浙江师范大学-网络继续教育学院-刷课 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.1.0 // @description try to take over the world! // @author anth0n9 // @run-at document-end // @match https://www.uteacher.net/ProjectTaskCourse/Play?* // @match https://www.uteacher.net/ProjectTaskCourse/List?* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant GM_setValue // @grant GM_getValue // ==/UserScript== (function() { 'use strict'; window.onload=function(){ //获取当前页面的url var href = window.location.href; console.log(href) if(href.indexOf("https://www.uteacher.net/ProjectTaskCourse/List")!=-1){ GM_setValue("href",href); let course = document.querySelectorAll('.item'); console.log('课程列表'); }else if(href.indexOf("https://www.uteacher.net/ProjectTaskCourse/Play")!=-1){ xuexi(); console.log("在视频界面"); }else{ console.log("不在预先设定的网址中,或者播放地址有修改") } } function xuexi(){ tanchuang(); var check = setInterval(function(){ let width = document.querySelector('.ccH5CurrentPro').offsetWidth; // console.log(width); if(width==830){ //播放完毕 if(document.getElementsByClassName("active")[3].parentNode.nextSibling){ //如果不是最后一个 document.getElementsByClassName("active")[3].parentNode.nextSibling.querySelector("a").click(); }else{ document.querySelector('.btnTYStyle').click(); } } },2000); //830 } function tanchuang(){ videoplayer(); setTimeout(function(){ if(document.querySelector('.layui-layer-btn1')){ document.querySelector('.layui-layer-btn1').click(); } },2000); } })();