Options
All
  • Public
  • Public/Protected
  • All
Menu

events found in Page.on

Hierarchy

  • PageOnEvents

Index

Properties

console

console: (details: ConsoleMessage, ...args: any[]) => void

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: (details: Dialog) => void

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: () => void

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: (details: ErrorDetails) => void

Emitted when the page crashes.

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

Type declaration

frameattached

frameattached: (details: Frame) => void

Emitted when a frame is attached.

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

Type declaration

    • Parameters

      Returns void

framedetached

framedetached: (details: Frame) => void

Emitted when a frame is detached.

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

Type declaration

    • Parameters

      Returns void

framenavigated

framenavigated: (details: Frame) => void

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: () => void

Emitted when the JavaScript load event is dispatched.

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

Type declaration

    • (): void
    • Returns void

metrics

metrics: (details: Metrics) => void

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: (details: ErrorDetails) => void

Emitted when an uncaught exception happens within the page.

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

Type declaration

popup

popup: (details: Frame) => void

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: (details: Request) => void

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: (details: Request) => void

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: (details: Request) => void

Emitted when a request finishes successfully.

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

Type declaration

response

response: (details: Response) => void

Emitted when a response is received.

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

Type declaration

workercreated

workercreated: (details: Worker) => void

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: (details: Worker) => void

Emitted when a dedicated WebWorker is terminated.

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

Type declaration

    • Parameters

      Returns void