国培网chinahrt.com刷课救星

这是一个能屏蔽国培网chinahrt.com刷课时自动暂停的脚本。

// ==UserScript==
// @name         国培网chinahrt.com刷课救星
// @namespace    undefined
// @version      0.1.0
// @description  这是一个能屏蔽国培网chinahrt.com刷课时自动暂停的脚本。
// @author       点灯 diandeng
// @match        *://*.chinahrt.com/*
// @icon 		 https://www.chinahrt.com/style/images/logo.png
// @supportURL   https://space.bilibili.com/21219957
// @run-at       document-start
// ==/UserScript==
(function () {
    'use strict';
    //屏蔽失去焦点时自动暂停
    window.onfocus = function () {
        console.log('on focus')
    };
    window.onblur = function () {
        console.log('on blur')
    };
    //自动刷课(未启用)
	/*
    //判断是否在课程列表
    if (window.location.href.indexOf("course/preview?") != -1) {
        var sections = document.getElementsByClassName("fr menu-zt")
            var completed_number = 0
            for (var i = 0; i < sections.length; i++) {
                if (sections[i].innerText.indexOf("学习中") != -1) {
                    completed_number++
                }
            }
            document.getElementsByClassName("menu")[0].getElementsByTagName("a")[completed_number - 1].click()
    }
	*/
})();