1
0
Fork 0

更新 'weixin/login.user.js'

master
502647092 2021-09-14 08:21:49 +00:00
parent d5142724dd
commit fa2ffcc4d2
1 changed files with 3 additions and 13 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name 微信登录通知
// @namespace https://miaowoo.cc/
// @version 0.2
// @version 0.3
// @description 自动化登录通知
// @author MiaoWoo
// @match https://pay.weixin.qq.com/index.php/core/home/login**
@ -69,18 +69,8 @@
while (!(img.src.startsWith('https://work.weixin.qq.com/wwqrlogin'))) {
await sleep(100)
}
await sleep(500)
let originClass = img.className
img.className = ''
// 创建canvas DOM元素并设置其宽高和图片一样
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
// 坐标(0,0) 表示从此处开始绘制,相当于偏移。
canvas.getContext("2d").drawImage(img, 0, 0);
img.className = originClass
let base64 = canvas.toDataURL()
await post(api, { base64, title: '企业微信' })
let src = img.src
await post(api, { src, title: '企业微信' })
}
async function main() {
if (location.origin == "https://pay.weixin.qq.com") {