Created
January 1, 2022 20:26
-
-
Save przemyslawjanpietrzak/46344b4689e7c4bd329d389451f1c076 to your computer and use it in GitHub Desktop.
gremlins2
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
module.exports.insertGremlins = async (page) => { | |
await page.evaluate(() => { | |
const s = document.createElement('script'); s.src='gremlins.min.js'; | |
document.head.appendChild(s); | |
}); | |
}; | |
module.exports.runGremlins = async (page) => { | |
await page.evaluate(() => { | |
window.gremlins.createHorde().unleash() | |
}); | |
}; | |
module.exports.wait = (time) => | |
new Promise((resolve) => { | |
setTimeout(resolve, time); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment