Greasy Fork

2024年智慧中小学暑假教师研修秒过

已打赢复活赛

// ==UserScript==
// @name         2024年智慧中小学暑假教师研修秒过
// @namespace    http://tampermonkey.net/
// @version      1145117.0
// @author       Alcex
// @description  已打赢复活赛
// @license      MIT
// @match        https://basic.smartedu.cn/*
// @match        https://www.smartedu.cn/*
// @match        https://teacher.vocational.smartedu.cn/*
// @match        https://core.teacher.vocational.smartedu.cn/*
// ==/UserScript==

(function() {
    'use strict';

    function skip() {
        let video = document.getElementsByTagName('video');
        if (video.length > 0) {
            video[0].play().catch(function() {});
            video[0].pause();
            video[0].currentTime = video[0].duration;
            video[0].play().catch(function() {});
        }
    }

    function removeModal() {
        try {
            var f = document.querySelector(".fish-modal-root");
            if (f) {
                f.remove();
            }
        } catch (e) {
            console.error("Error in removeModal function:", e);
        }
    }

    setInterval(skip, 100);
    setInterval(removeModal, 1000);
})();