Greasy Fork is available in English.

天津老师刷课

try to take over the world!

// ==UserScript==
// @name         天津老师刷课
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       FAKE_DAVE
// @match        *://*.chinahrt.com/*
// @grant        none
// ==/UserScript==

(function() {
    //去除视频失去焦点暂停限制
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()
}
    'use strict';

    // Your code here...
})();