Greasy Fork

Greasy Fork is available in English.

博思刷时间

博思增加学习时间使用方法找个视频的课程挂着

当前为 2021-07-11 提交的版本,查看 最新版本

// ==UserScript==
// @name        博思刷时间
// @version      0.1
// @description  博思增加学习时间使用方法找个视频的课程挂着
// @author       lgldlk
// @match         *://aiit.iflysse.com/Pages/Student/*
// @grant        none
// @namespace http://greasyfork.icu/users/706935
// ==/UserScript==

(function() {
    function waitForNode(nodeSelector, callback) {
        var node = nodeSelector();
        if (node) {
            callback(node);
        } else {
            setTimeout(function() { waitForNode(nodeSelector, callback); }, 100);
        }
    }
    function debounce(func, wait) {
        let timer;
        return function() {
            let context = this;
            let args = arguments;
            if (timer) clearTimeout(timer);
            timer = setTimeout(() => {
                func.apply(this, args)
            }, wait)
        }
    }
const initRateBody = function(callBack) {
    waitForNode(() => document.getElementsByTagName("video")[0],
        (node) => {
        console.log("initRateBody");
            var oV = document.getElementsByTagName("video")[0];
               oV.addEventListener('ended',
      ()=>{
                 oV.currentTime=0;
          oV.play();
              }
    , false);
        });
};
window.onload = initRateBody(null);
})();