SZU Auto

内部网首页左上角增加 Dr.com 入口;免去进入 Blackboard 的繁琐步骤;自动登录(不可用)进入 blackboard, ehall, Dr.com 等页面;【使用该脚本前请仔细阅读使用说明】

目前為 2020-10-26 提交的版本,檢視 最新版本

// ==UserScript==
// @name         SZU Auto
// @name:en      SZU Auto
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  内部网首页左上角增加 Dr.com 入口;免去进入 Blackboard 的繁琐步骤;自动登录(不可用)进入 blackboard, ehall, Dr.com 等页面;【使用该脚本前请仔细阅读使用说明】
// @description:en  内部网首页左上角增加 Dr.com 入口;免去进入 Blackboard 的繁琐步骤;自动登录(不可用)进入 blackboard, ehall, Dr.com 等页面;【使用该脚本前请仔细阅读使用说明】
// @author       cc
// @match        https://elearning.szu.edu.cn/*
// @match        https://authserver.szu.edu.cn/*
// @match        http://ehall.szu.edu.cn/*
// @match        172.30.255.2/*
// @match        https://www1.szu.edu.cn/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const USERNAME = 'You username';
    const PASSWORD = 'You password';
    const RECURSION_DURATION = 250;
    var extra_times = 0;
    (function recursion () {
        console.log('in recursion');
        if (location.host == 'elearning.szu.edu.cn') {
            if (location.href == 'https://elearning.szu.edu.cn/' || location.href == 'https://elearning.szu.edu.cn/webapps/login/') {
                let span = document.querySelector('table table table tr td a span');
                if (span) {
                    span.click();
                };
            } else if (location.href.includes('webapps/portal/')) {
                let button_1 = document.querySelector('.button-1');
                if (button_1) {
                    button_1.click();
                };
            };
        } else if (location.host == 'authserver.szu.edu.cn') {
            let username = document.getElementById('username');
            let password = document.getElementById('password');
            let button = document.querySelector('button');
            if (username && password && button) {
                username.value = USERNAME;
                password.value = PASSWORD;
                extra_times = 750;
                button.click();
                setTimeout(() => { extra_times = 0; }, RECURSION_DURATION);
            };
        } else if (location.host == 'ehall.szu.edu.cn') {
            let ampHasNoLogin = document.getElementById('ampHasNoLogin');
            if (ampHasNoLogin) {
                ampHasNoLogin.click();
            };
        } else if (location.host == '172.30.255.2') {
            if (location.href.includes('0.htm')) {
                let username = document.getElementById('username');
                let password = document.getElementById('password');
                let submit = document.querySelector('#submit[type=submit]');
                if (username && password && submit) {
                    username.value = USERNAME;
                    password.value = PASSWORD;
                    submit.click();
                };
            };
        } else if (location.host == 'www1.szu.edu.cn') {
            let a = document.querySelector("a[href='v.asp?id=136']");
            let a_new = document.getElementById('drcom');
            if (a && !a_new) {
                a_new = document.createElement('a');
                a_new.href = 'http://172.30.255.2/0.htm';
                a_new.id = 'drcom';
                a_new.innerHTML = '|登录(不可用) Dr.com';
                a.parentNode.appendChild(a_new);
            };
        };
        setTimeout(recursion, RECURSION_DURATION + extra_times);
    })();
})();

QingJ © 2025

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