Skip to content

Instantly share code, notes, and snippets.

@przemyslawjanpietrzak
Created January 1, 2022 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save przemyslawjanpietrzak/46344b4689e7c4bd329d389451f1c076 to your computer and use it in GitHub Desktop.
Save przemyslawjanpietrzak/46344b4689e7c4bd329d389451f1c076 to your computer and use it in GitHub Desktop.
gremlins2
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