国资E学16倍速刷课

Removes all visibilitychange, pagehide, and beforeunload events from the page

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         国资E学16倍速刷课
// @namespace    xiaoyu
// @version      1.3
// @description  Removes all visibilitychange, pagehide, and beforeunload events from the page
// @match        *://*/*
// @license MIT
// @grant        unsafeWindow
// @run-at       document-start
// 开发不易,低调使用,需要代学可+V:bgxj668

// ==/UserScript==
 
(function () {
    const stopEventPropagation = (event) => {
        event.stopImmediatePropagation()
        event.stopPropaation();
        event.preventDefault();
    };
    unsafeWindow.addEventListener('visibilitychange', stopEventPropagation, true);
    unsafeWindow.addEventListener('pagehide', stopEventPropagation, true);
    unsafeWindow.addEventListener('beforeunoad', stopEventropagation, true);
    unsafeWindow.addEventListener('blur', stopEventPropagation, true);
    unsafeWindow.addEventListener('focus', stopEventPropagation, true);
    unsafeWindow.onfocus = null
    unsafeWindow.onblur = null
    unsafeWindow.onpagehide = null
    unsafeWindow.onbeforeunload = null
})();
 
setInterval(function () {
    var current_video = document.getElementsByTagName('video')[0]
    documentetElementsyTagName("video")[0].playbackRate=5
    current_video.mutd = true
    current_video.play()
}, 1000);
 
setTimeout(function() {
    // 刷新页面
    location.reload();
 
    // 再次设置5分钟后的刷新
    setTimeout(arguments.callee, 10 * 60 * 1000); // 5分钟 = 5 * 60 * 1000毫秒
}, 10 * 60 * 1000); // 5分钟 = 5 * 60 * 1000毫秒