Skip to content

Instantly share code, notes, and snippets.

@timcash
Created June 20, 2023 22:36
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 timcash/4ad84bbb215716c5e226f1597542ea1f to your computer and use it in GitHub Desktop.
Save timcash/4ad84bbb215716c5e226f1597542ea1f to your computer and use it in GitHub Desktop.
mainPage.on("console", (message) => {
if (message.type() === "error") {
// if message has 404, ignore it
if (message.text().includes("404")) {
return;
}
log(ll.alert, "PAGE:", message.text());
} else {
log(ll.info, "PAGE:", message.text());
}
});
// Use this to see all requests made by the page
mainPage.route("**", (route) => {
// console.log(route.request().url());
route.continue();
});
// Use this evaluate javascript in the page
await mainPage.evaluate(() => {
console.info("browser logging attached");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment