Last active
August 19, 2021 05:50
-
-
Save duydev/c6ae0d0b10219ba9d2a1085d054b27fa to your computer and use it in GitHub Desktop.
Popcat.click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trigger() { | |
var keyboardEvent = document.createEvent('KeyboardEvent'); | |
var initMethod = | |
typeof keyboardEvent.initKeyboardEvent !== 'undefined' | |
? 'initKeyboardEvent' | |
: 'initKeyEvent'; | |
keyboardEvent[initMethod]( | |
'keydown', // event type: keydown, keyup, keypress | |
true, // bubbles | |
true, // cancelable | |
window, // view: should be window | |
false, // ctrlKey | |
false, // altKey | |
false, // shiftKey | |
false, // metaKey | |
40, // keyCode: unsigned long - the virtual key code, else 0 | |
0 // charCode: unsigned long - the Unicode character associated with the depressed key, else 0 | |
); | |
document.dispatchEvent(keyboardEvent); | |
} | |
function auto() { | |
Array(799) | |
.fill() | |
.forEach(() => trigger()); | |
setTimeout(() => { | |
auto(); | |
}, 30000); | |
} | |
auto(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment