Created
September 10, 2020 12:59
-
-
Save supermarsx/3cbb701b124532d64534f7a80c13a931 to your computer and use it in GitHub Desktop.
Waits for jQuery injection with puppeteer
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
/* | |
waitForJqueryInjection | |
Waits for jQuery injection with puppeteer | |
parameters | |
page (object) - Puppeteer page object | |
*/ | |
async function waitForJqueryInjection(page) { | |
// Waiting for jQuery injection | |
console.log('Waiting for jQuery injection > (page)'); | |
const watchDog = page.waitForFunction('window.jQuery !== undefined'); | |
await watchDog; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment