Greasy Fork is available in English.

Diskusie » Vývoj

js console click() problem / js在控制台中点事件无效的问题

Pridaný: 28.05.2023

Why is it that using `click()` in the JavaScript console does not trigger the click event, while using the mouse does work?


Pridaný: 28.05.2023

$ is jquery and that might be undefined, try using js instead

Also don't use chinese, use the class in english, that might help

Pridaný: 29.05.2023
Upravený: 29.05.2023

I see one obvious reason, probably handler checks if click is isTrusted (click event's property), that property indicates if action (in current example, click) was done by the user or the code. You can read about it in MDN. I tried to spoof it in many ways, I used Proxies, replaced prototype, copied event object etc. But nothing worked out, so it's well secured, I don't think it can be spoofed.

Pridať odpoveď

Aby ste mohli pridať odpoveď, prihláste sa.