feat: auto refresh when mcbbs return 504
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
// ==UserScript==
 | 
			
		||||
// @name         MCBBS自动售卖机
 | 
			
		||||
// @namespace    https://miaowoo.cc/
 | 
			
		||||
// @version      0.7.0
 | 
			
		||||
// @version      0.7.1
 | 
			
		||||
// @description  自动售卖道具
 | 
			
		||||
// @author       MiaoWoo
 | 
			
		||||
// @match        https://www.mcbbs.net/home.php?mod=magic**
 | 
			
		||||
@@ -35,6 +35,9 @@
 | 
			
		||||
        tbn.append(slaveLi)
 | 
			
		||||
    }
 | 
			
		||||
    async function main() {
 | 
			
		||||
        if (document.getElementsByTagName('h1')[0].innerText.startsWith(504)) {
 | 
			
		||||
            return refresh()
 | 
			
		||||
        }
 | 
			
		||||
        createMenu()
 | 
			
		||||
        params = location.href.split('?')[1].split('&').map(s => s.split('=')).reduce((pre, cur, index) => { pre[cur[0]] = cur[1]; return pre }, {})
 | 
			
		||||
        if (!params.nodeType) { return console.log('nodeType is undefined skip...') }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user