cxxjackie
发表于 2022-10-26 12:32:23
steven026 发表于 2022-10-26 11:34
!(data/attachment/forum/202210/26/113954qxwzu3tfdrr4a3xa.png)
再说一种简单的手动方法,需要借助De ...
改原型副作用有点大,其实这样就行:
Object.setPrototypeOf(fakeObj, MouseEvent.prototype);
steven026
发表于 2022-10-26 13:16:39
cxxjackie 发表于 2022-10-26 12:32
改原型副作用有点大,其实这样就行:
还能这样……学会了 GGNB
朱焱伟
发表于 2022-10-26 21:12:43
```javascript
// ==UserScript==
// @name 【歪门邪道】过掉isTrusted检测之沙雕做法
// @namespace test-case.ggnb.top
// @version 0.0.1
// @descriptionSB
// @match http://test-case.ggnb.top/is_trusted/is_trusted.html
// @match http://test-case.ggnb.top/is_trusted/is_trusted_2.html
// @run-at document-start
// ==/UserScript==
ws = new WebSocket("ws://localhost:19810")
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function WrapperWS() {
this.send = function (message, callback) {
this.waitForConnection(function () {
ws.send(message);
if (typeof callback !== 'undefined') {
callback();
}
}, 1000);
};
this.waitForConnection = function (callback, interval) {
if (ws.readyState === 1) {
callback();
} else {
var that = this;
// optional: implement backoff for interval here
setTimeout(function () {
that.waitForConnection(callback, interval);
}, interval);
}
};
console.log('connected')
console.log('任何邪恶,终将绳之以法!')
sleep(3000)
send('a')
}
WrapperWS()
```
配合:
```python
import asyncio
import websockets
import pyautogui
import time
async def watchlist(websocket, path):
while True:
key = await websocket.recv()
pyautogui.press('f11')
time.sleep(2)
print('全屏后点击...')
pyautogui.click(42,25)#摆烂
start_server = websockets.serve(watchlist, "localhost", 19810)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
```
和按键精灵,autojs,puppeteer没本质区别,鉴定为烂。
## 相关资料
- (https://stackoverflow.com/questions/44912905/how-to-set-a-created-events-istrusted-property-in-javascript-using-greasemonk)
- (https://stackoverflow.com/questions/23051416/uncaught-invalidstateerror-failed-to-execute-send-on-websocket-still-in-co)
- (https://news.ycombinator.com/item?id=26523507)
Vikrant
发表于 2022-10-27 17:29:28
本帖最后由 Vikrant 于 2022-10-27 17:31 编辑
各路大佬各显神通,而我的小脑瓜子大概只能想到这种东西 (⊙x⊙;)
import pyautogui as pag
import time
def myClick(im):
while 1:
if pag.locateOnScreen(im,grayscale=True):
x,y=pag.locateCenterOnScreen(im,grayscale=True)
pag.click(x,y)
break
time.sleep(0.3)
myClick("btn.jpg")
唉,以前我还不会用JavaScript写油猴脚本的时候,我一直都是用 python图像识别+操控键鼠 来实现自动刷网课的,想想当时真是一个小天才 ( ‵▽′)ψ
请各路大佬轻喷
王一之
发表于 2022-11-19 18:15:36
@李恒道 ,再不来活动就结束停止了
李恒道
发表于 2022-11-20 17:05:14
王一之 发表于 2022-11-19 18:15
@李恒道 ,再不来活动就结束停止了
还在学react
呜呜呜
先停止吧