东营市继续教育网专业科目培训平台-使用请添加微信bzm8866999
// ==UserScript==
// @name 东营市继续教育网专业科目培训平台-使用请添加微信bzm8866999
// @namespace http://tampermonkey.net/
// @version 2.1
// @license MIT
// @description 不知名的打工仔
// @author You
// @match http://sddy.zyk.yxlearning.com/learning/index?myClassId=*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net.cn
// @grant none
// ==/UserScript==
(function () {
'use strict';
const addBox = () => {
var parent = document.createElement("div");
parent.innerHTML = ` <div
style="position: fixed;left: 10%;
z-index: 99999;
top: 10%;">
<button class="start">开始</button>
</div>`
// <button class="stop">暂停</button>
// <button class="end">结束</button>
document.body.append(parent)
document.querySelector(".start").setAttribute("style",`background-color: red;
color: #fff;
font-size: 22px;`)
document.querySelector(".start").addEventListener("click", () => {
play()
})
}
const play = () => {
document.querySelector(".course-list").click()
var pvCover = document.querySelector(".pv-video")
pvCover.play()
setInterval(()=>{
document.querySelector(".pv-ask-modal-wrap").remove()
pvCover.play()
},1000);
addMonitor()
}
const loading = () => {
addBox()
}
const addMonitor = () => {
document.querySelector(".pv-video").addEventListener(
'ended',
() => {
//结束
console.log('播放结束');
setTimeout(()=>{
play()
},2000)
},
false
);
}
// Your code here...
// 等待网页完成加载
window.addEventListener('load', function () {
// 加载完成后执行的代码
loading()
}, false);
})();