Skip to content

Instantly share code, notes, and snippets.

@emilhein
Created June 12, 2022 05:12
Show Gist options
  • Save emilhein/e163f40a5ac5599c3313f5457e4e61dd to your computer and use it in GitHub Desktop.
Save emilhein/e163f40a5ac5599c3313f5457e4e61dd to your computer and use it in GitHub Desktop.
const readGlobalVar = async ({ page }) => {
try {
let variable = await page.evaluate(() => window.myVaraible)
return variable
} catch (error) {
return Promise.reject(error)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment