灯塔党建党员教育挂机学习

灯塔党建在线挂机学习脚本

目前为 2021-05-06 提交的版本。查看 最新版本

// ==UserScript==
// @name         灯塔党建党员教育挂机学习
// @namespace    **************
// @version      0.999
// @description  灯塔党建在线挂机学习脚本
// @author       luter
// @match        *.dtdjzx.gov.cn/course/special/*
// @match        *.dtdjzx.gov.cn/*
// @grant        none    
// ==/UserScript==
 (function ()
	{setTimeout(function()
		{if(window.location.href.indexOf("#/home")!=-1){
        window.close();
        }
           else
           {
               if(window.location.href.indexOf("studyCours")!=-1)//课程列表页判断
        		{document.getElementsByClassName("el-table__row")[0].getElementsByClassName("cell")[6].getElementsByTagName("span")[1].click();
                 window.opener = null;
                 window.open(' ','_self');
                 window.close();}
                else
                {document.getElementsByTagName("video")[0].muted = true;
                 document.getElementsByTagName("video")[0].play();
                 setInterval(function ()
    				{ var ti = document.getElementsByTagName("video")[0].duration-document.getElementsByTagName("video")[0].currentTime
                    console.log(ti)
                    if(ti ==0)
                    {setTimeout(function(){document.querySelector("#app > div > div.nav > div > ul > li:nth-child(10) > a").click();},10000);
                        //window.close();
                     setTimeout(function(){window.location.reload();},20000);
                    }
                    }, 10000);
    			}
    	}
        }, 10000);
    }
    )();