Last active
January 16, 2025 00:24
-
-
Save phxgg/a81e166d181cb3993f985a3c005b6b73 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // paste this in the console before starting EZ Clap | |
| const gameArea = document.getElementById('game-area'); | |
| function waitForClassRemoval(element, className, callback) { | |
| const observer = new MutationObserver((mutations) => { | |
| mutations.forEach((mutation) => { | |
| if (mutation.attributeName === 'class') { | |
| if (element.classList.contains(className)) { | |
| console.log(`Class ${className} added. Waiting for removal...`); | |
| } else { | |
| console.log(`Class ${className} removed. Performing click...`); | |
| callback(); | |
| } | |
| } | |
| }); | |
| }); | |
| observer.observe(element, { attributes: true }); | |
| } | |
| waitForClassRemoval(gameArea, 'waiting', () => { | |
| gameArea.click(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment