// ==UserScript== // @name 中建一局先锋学堂_挂机 // @namespace http://tampermonkey.net/ // @version 2.0 // @description 挂机看 中建一局先锋学堂 // @author kakasearch // @match https://cscec1b.zhixueyun.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=cscec1b.zhixueyun.com // @require https://greasyfork.org/scripts/425166-elegant-alert-%E5%BA%93/code/elegant%20alert()%E5%BA%93.js?version=922763 // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; if(/study\/course\/detail/.test(window.location.href)){ setInterval(function(){ let state = document.querySelector("dl.focus > div.chapter-right > div.section-item.section-item11 > div:nth-child(3) > span") state = state?state.innerText:null if(state == "已完成"){ new ElegantAlertBox("准备播放下一个视频>__<") let courses = document.querySelectorAll("dl") for(let i of courses){ if(i.querySelector("div.chapter-right > div.section-item.section-item11 > div:nth-child(3) > span").innerText != "已完成"){ i.click() return } } //alert("已经全部学完") window.close() }else{ new ElegantAlertBox("还没有学习完 >__<") if('display: none;' != document.querySelector(".register-mask-layer").getAttribute("style")){ document.querySelector("#D210registerMask").click() } } },5000) } // Your code here... })();