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
Unified authentication: Bypass verification code, focus on the login button (so you only need to hit Enter
to login)
USTC Mail: Automatically switch mail domain, focus on the login button
Rec: Auto clicking into USTC CAS login page; Setting certain links to open at the current tab (can greatly improve performance)
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
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.