// ==UserScript== // @name 云端学习(第四种类型课程) // @namespace http://tampermonkey.net/ // @version 1.0 // @description 网课学习4 // @author Feng // @include https://tech.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do?* // @match https://tech.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do?* // @grant none // @downloadURL none // ==/UserScript== var a= document.getElementsByClassName("cl-head-tip"); var b= document.getElementsByClassName("cl-play cl-doc-play"); if(a.length==1&&b.length==1) {var myVar = setInterval(function(){ autoplay() }, 5000);} function autoplay() { var span1=$(minStudyTime).html(); var span2=$(studiedTime).html(); if(span1==span2) {Submit(); var span3 = document.getElementsByClassName("cl-go-link"); span3[1].click(); stopplay();}} function stopplay() { clearInterval(myVar);} function Submit() { var x=document.getElementsByClassName("top-title"); if (x.legth!=0) {if(x[0].title=="恭喜您已经完成课程") {var y=document.getElementsByClassName("only-one-btn elpui-layer-btn0"); y[0].click();}}}