Options
All
  • Public
  • Public/Protected
  • All
Menu

events found in Page.on

Hierarchy

  • PageOnEvents

Index

Properties

console

console: function

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});
});

Type declaration

dialog

dialog: function

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});
});

Type declaration

    • Parameters

      Returns void

domcontentloaded

domcontentloaded: function

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");
});

Type declaration

    • (): void
    • Returns void

error

error: function

Emitted when the page crashes.

page.on("error",(details)=>{
page.meta.log("page on error",{details});
});

Type declaration

frameattached

frameattached: function

Emitted when a frame is attached.

page.on("frameattached",(details)=>{
page.meta.log("page on frameattached",{details});
});

Type declaration

    • Parameters

      Returns void

framedetached

framedetached: function

Emitted when a frame is detached.

page.on("framedetached",(details)=>{
page.meta.log("page on framedetached",{details});
});

Type declaration

    • Parameters

      Returns void

framenavigated

framenavigated: function

Emitted when a frame is navigated to a new url.

page.on("framenavigated",(details)=>{
page.meta.log("page on framenavigated",{details});
});

Type declaration

    • Parameters

      Returns void

load

load: function

Emitted when the JavaScript load event is dispatched.

page.on("load",()=>{
page.meta.log("page on framenavigated");
});

Type declaration

    • (): void
    • Returns void

metrics

metrics: function

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});
});

Type declaration

pageerror

pageerror: function

Emitted when an uncaught exception happens within the page.

page.on("pageerror",(details)=>{
page.meta.log("page on pageerror",{details});
});

Type declaration

popup

popup: function

Emitted when the page opens a new tab or window.

page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});

Type declaration

    • Parameters

      Returns void

request

request: function

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});
});

Type declaration

requestfailed

requestfailed: function

Emitted when a request fails, for example by timing out.

page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});

Type declaration

requestfinished

requestfinished: function

Emitted when a request finishes successfully.

page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});

Type declaration

response

response: function

Emitted when a response is received.

page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});

Type declaration

workercreated

workercreated: function

Emitted when a dedicated WebWorker is spawned by the page.

page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});

Type declaration

    • Parameters

      Returns void

workerdestroyed

workerdestroyed: function

Emitted when a dedicated WebWorker is terminated.

page.on("popup",(details)=>{
page.meta.log("page on popup",{details});
});

Type declaration

    • Parameters

      Returns void