Skip to content

Instantly share code, notes, and snippets.

@supermarsx
Created September 10, 2020 12:59
Show Gist options
  • Save supermarsx/3cbb701b124532d64534f7a80c13a931 to your computer and use it in GitHub Desktop.
Save supermarsx/3cbb701b124532d64534f7a80c13a931 to your computer and use it in GitHub Desktop.
Waits for jQuery injection with puppeteer
/*
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