Greasy Fork is available in English.

雨课堂后台播放刷时长

当前版本仅解决hasFocus问题,先能够后台播放

// ==UserScript==
// @name        雨课堂后台播放刷时长
// @namespace   http://tampermonkey.net/
// @version     0.0.1
// @description 当前版本仅解决hasFocus问题,先能够后台播放
// @author      HengY1
// @match       *://*.yuketang.cn/pro/lms/*
// @grant       none
// @license     MIT
// @run-at      document-start
// ==/UserScript==


(function () {
    'use strict';
    const originalHasFocus = document.hasFocus;
    document.hasFocus = function() {
        var originData = originalHasFocus.apply(document, arguments);
        console.log('document.hasFocus 被调用: ' + originData);
        return true; // 强制欺骗聚焦在页面
    };
})();