forked from ChinaGodMan/UserScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
29 lines (27 loc) · 986 Bytes
/
Copy pathmain.js
File metadata and controls
29 lines (27 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { modal, DomUtils, init, config, i18n } from '@/env'
GM_registerMenuCommand(i18n.translate('menu'), function () {
modal.createModal()
})
window.addSizeToRepos = init.addSizeToRepos
// Add the size to the repos on the page
window.onload = function () {
//addSizeToRepos()
}
document.addEventListener('DOMContentLoaded', () => {
DomUtils.main()
if (config.SECRET) {
DomUtils.waitForElement('#app_totp', false)//
.then(() => {
generateTOTP(SECRET).then(totp => {
const totpInput = document.querySelector('#app_totp')
const submitButton = totpInput.parentElement.querySelector('button[type=\'submit\']')
totpInput.value = totp
submitButton.click()
})
})
.catch((error) => {
console.error('totp发生了错误,找不到元素')
})
}
})
DomUtils.observeUrlChanges(DomUtils.main)