// ==UserScript== // @name 湖南人力资源-湖南师范大学 // @namespace 自动看,自动切换vx:shuake345 // @version 0.1 // @description 湖南师范大学自动 // @author vx:shuake345 // @match *://jyjd.hunnu.edu.cn/personCenter/* // @grant none // ==/UserScript== (function() { 'use strict'; window.alert = function() { } window.onbeforeunload = null window.confirm = function() { return true } var Zhuyurl = 'personCenter/index' var Chuyurl = 'personCenter/personCenterStudyDetail' var Shuyurl = 'CourseWare' var Fhuyurl = '&courseware' function fhback() { window.history.go(-1) } function gbclose() { window.close() } function sxrefere() { window.location.reload() } function Zhuy() { //var KC = document.querySelectorAll('.item>ul>li>a') //[0].href var KCjd = document.querySelectorAll("div> div.newsList.el-row > div> button") //[0].innerText for (var i = 0; i < KCjd.length; i++) { if (KCjd[i].innerText !== '已完成学习') { KCjd[i].click() break; } } } function Chuy() { var JD=document.querySelectorAll("div > div > div > ul > li> div > div > div > span.f-right")//[2].innerText var videos=document.getElementsByTagName('video')[0]//.paused if(videos.paused ==true){ videos.play() } } function Shuy() { if (document.URL.search(Shuyurl) > 2) { var zzKC = document.querySelectorAll('tbody>tr>td>span') var zzKCurl = document.querySelectorAll('tbody>tr>td>a') for (var i = 0; i < zzKC.length; i++) { if (zzKC[i].innerText == '未学完' || zzKC[i].innerText == '未开始') { localStorage.setItem('Surl', window.location.href) window.location.replace(zzKCurl[i].href) break; } else if (i == zzKC.length - 1) { setTimeout(gbclose, 1104) } } } } setInterval(Shuy, 3124) function Fhuy() { if (document.getElementsByTagName('video').length == 1) { document.getElementsByTagName('video')[0].volume = 0 document.getElementsByTagName('video')[0].play() } if (document.querySelector('iframe').contentWindow.document.querySelector('span.qplayer-currtime').innerText == document.querySelector('iframe').contentWindow.document.querySelector('span.qplayer-totaltime').innerText) { window.location.replace(localStorage.getItem('Surl')) } } function Pd() { if (document.URL.length> 100) {//ciye setTimeout(Chuy, 210) } else {//zhuye setTimeout(Zhuy, 324) } } setInterval(Pd, 8254) })();