USTC Helper

Various useful functions for USTC students: verification code bypass, auto login, rec performance improvement and more.

目前為 2022-11-25 提交的版本,檢視 最新版本

作者
PRO-2684
評價
0 0 0
版本
0.5.0
建立日期
2022-10-22
更新日期
2022-11-25
尺寸
30.4 KB
授權條款
Unlicense
腳本執行於

Notice

Due to certain bug(s) of Tampermonkey, Rec optimizing feature in the newest version (0.5.0) might not work as expected. If you want this feature badly, you can downgrade to version 0.4.1.

Functions

  1. Unified authentication: Bypass verification code, focus on the login button (so you only need to hit Enter to login)

  2. USTC Mail: Automatically switch mail domain, focus on the login button

  3. Rec: Auto clicking into USTC CAS login page; Setting certain links to open at the current tab (can greatly improve performance)

  4. BB System(Online Teaching Platform): Auto clicking login at both main page and the page asking for authentication if you access the site outside the campus network

  5. Education Administration System: Auto focus on or click login button.

If you need a certain feature, leave a comment and I might add it as far as I can.

Configuation

Navigate to control panel, click this script and then navigate to "Storage" which is next to "Settings". If it does not appear, you should visit any website this scripts matches and then try again. After this, modify the storage yourself according to the default config shown below (you should use json format and make sure to cover every item under each option), and then click "save". Your config here will override the default config, and redundant options will be ignored.

var uhp_config = {
    passport: {
        enabled: true, // If false, all features will be disabled for passport.ustc.edu.cn
        bypass_code: true, // Whether to bypass verification code or not
        focus: true // Whether to focus on "Login" button
    },
    mail: {
        enabled: true, // If false, all features will be disabled for mail.ustc.edu.cn
        focus: true, // Whether to focus on "Login" button
        domain: 'mail.ustc.edu.cn' // Automatically switch to given mail domain
        // Expected values:
        // 'mail.ustc.edu.cn'
        // 'ustc.edu.cn'
        // 'ah.edu.cn'
        // '' (Do nothing)
    },
    rec: {
        enabled: true, // If false, all features will be disabled for rec.ustc.edu.cn & recapi.ustc.edu.cn
        autologin: true, // Whether automatically clicks login (USTC cas login)
        opencurrent: true // Whether open certain supported links in current tab (can greatly improve loading speed)
    },
    bb: {
        enabled: true, // If false, all features will be disabled for www.bb.ustc.edu.cn
        autoauth: true, // Whether automatically authenticate when accessing the site outside campus network
        autologin: true // Whether automatically clicks login on the main page
    },
    jw: {
        enabled: true, // ...
        login: 'focus' // What to do to the login button: 'none', 'focus', 'click'
    }
};

For example, you may write:

{
    "passport": {
        "enabled": true,
        "bypass_code": false,
        "focus": true
    }
}

But don't do this ("focus" item missing under option "passport"):

{
    "passport": {
        "enabled": true,
        "bypass_code": false
    }
}

In order to force display "Storage" tab, the script will set value "foo" to "bar", which does not affect your using. However, in case you find it annoying, you can comment out the code at line 25 and then save it. Of course, you can simply modify default config in the source code, but you'll lose your config after updating.

QingJ © 2025

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