北化网课雨

try to take over the world!

目前为 2023-03-17 提交的版本。查看 最新版本

// ==UserScript==
// @name         北化网课雨
// @namespace    http://tampermonkey.net/
// @version      0.2.1
// @description  try to take over the world!
// @author       Snowman
// @match        https://buct.yuketang.cn/pro/*/*/*/video/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=yuketang.cn
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    function CloseWindow() {
        var userAgent = navigator.userAgent;
        if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") != -1) {
            window.location.href = "about:blank";
            window.close();
        } else {
            window.opener = null;
            window.open("", "_self");
            window.close();
        }
    }

    var EleManager = {
        Register: function (name, selector) {
            if (this[name] == undefined) {
                this[name] = document.querySelector(selector);
            }
        }
    };

    function Init() {

        document.hasFocus = el_psy_congroo => true;

        setTimeout(() => {
            EleManager.Register("title", "#app > div.app-wrapper > div.wrap > div.viewContainer.heightAbsolutely > div > div.video-wrap > div.box > div > section.title > div.title-fl");
            EleManager.title.innerHTML += `<div style="color:green;"><font>(已黑化)</font><font id="sg-rate"></font></div>`;
            EleManager.Register("rate", "#sg-rate");
            console.log("完成了喵~");
        }, 1000);

        //setInterval(() => {
           // let n = window.rate;
           // EleManager.rate.innerText = n;
           // if (n >= 1) CloseWindow();
        //}, 1000)
        var el;
        setInterval(()=>{
            if (el == undefined) {
                el = document.querySelector("#app > div.app-wrapper > div.wrap > div.viewContainer.heightAbsolutely > div > div.video-wrap > div.box > div > section.title > div.title-fr > div > div > span");
                if (el == undefined) {
                    setTimeout(()=>{
                        location.reload();
                    },1000);
                }
            }
            let n = Number(el.innerText.slice(4,-1));
            if (n >= 100) {
                CloseWindow();
            }
        }, 1000);
    }

    Init();

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

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址