// ==UserScript==
// @name 河南教师培训网
// @namespace http://tampermonkey.net/
// @version 2024-12-14
// @description try to take over the world!
// @author You
// @match https://www.teachersedu.cn/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=teachersedu.cn
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
let curVideoSrc = ''
setVideo()
function setVideo () {
let video = document.querySelector('video')
if (video && video.src !== curVideoSrc) {
curVideoSrc = video.src
video.addEventListener('ended', function () {
let div_current = document.querySelector('.task-item.active')
let next = div_current.parentNode.parentNode.parentNode.nextElementSibling
next.querySelector('a').click()
})
}
}
setInterval(() => {
let button = document.querySelector('.alert-box-btns .confirm-btn')
if (button && button.innerText === '下一节') {
button.click()
}
setVideo()
}, 3000)
})();