Emitted when JavaScript within the page calls one of console API methods, e.g. console.log or console.dir. Also emitted if the page throws an error or a warning.
page.on("console",(details,...args)=>{
page.meta.log("page on console",{details,args});
});
Emitted when a JavaScript dialog appears, such as alert, prompt, confirm or beforeunload. Puppeteer can respond to the dialog via Dialog's accept or dismiss methods.
page.on("dialog",(details)=>{
page.meta.log("page on dialog",{details});
});
Emitted when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
page.on("domcontentloaded",()=>{
page.meta.log("page on domcontentloaded");
});
Emitted when the page crashes.
page.on("error",(details)=>{
page.meta.log("page on error",{details});
});
Emitted when a frame is attached.
page.on("frameattached",(details)=>{
page.meta.log("page on frameattached",{details});
});
Emitted when a frame is detached.
page.on("framedetached",(details)=>{
page.meta.log("page on framedetached",{details});
});
Emitted when a frame is navigated to a new url.
page.on("framenavigated",(details)=>{
page.meta.log("page on framenavigated",{details});
});
Emitted when the JavaScript load event is dispatched.
page.on("load",()=>{
page.meta.log("page on framenavigated");
});
Emitted when the JavaScript code makes a call to console.timeStamp
.
For the list of metrics see page.metrics
.
page.on("metrics",(details)=>{
page.meta.log("page on metrics",{details});
});
Emitted when an uncaught exception happens within the page.
page.on("pageerror",(details)=>{
page.meta.log("page on pageerror",{details});
});
Emitted when the page opens a new tab or window.
page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});
Emitted when a page issues a request. The request object is read-only. In order to intercept and mutate requests, see page.setRequestInterceptionEnabled.
page.on("request",(details)=>{
page.meta.log("page on request",{details});
});
Emitted when a request fails, for example by timing out.
page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});
Emitted when a request finishes successfully.
page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});
Emitted when a response is received.
page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});
Emitted when a dedicated WebWorker is spawned by the page.
page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});
Emitted when a dedicated WebWorker is terminated.
page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});
events found in Page.on