docs/api/puppeteer.pageevent.md
All the events that a page instance may emit.
export declare const enum PageEvent
Member
</th><th>Value
</th><th>Description
</th></tr></thead> <tbody><tr><td>Close
</td><td>"close"
Emitted when the page closes.
</td></tr> <tr><td>Console
</td><td>"console"
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.
Remarks:
A console event provides a ConsoleMessage representing the console message that was logged.
Dialog
</td><td>"dialog"
Emitted when a JavaScript dialog appears, such as alert, prompt, confirm or beforeunload. Puppeteer can respond to the dialog via Dialog.accept() or Dialog.dismiss().
DOMContentLoaded
</td><td>"domcontentloaded"
Emitted when the JavaScript DOMContentLoaded event is dispatched.
</td></tr> <tr><td>Error
</td><td>"error"
Emitted when the page crashes. Will contain an Error.
FrameAttached
</td><td>"frameattached"
Emitted when a frame is attached. Will contain a Frame.
</td></tr> <tr><td>FrameDetached
</td><td>"framedetached"
Emitted when a frame is detached. Will contain a Frame.
</td></tr> <tr><td>FrameNavigated
</td><td>"framenavigated"
Emitted when a frame is navigated to a new URL. Will contain a Frame.
</td></tr> <tr><td>Load
</td><td>"load"
Emitted when the JavaScript load event is dispatched.
</td></tr> <tr><td>Metrics
</td><td>"metrics"
Emitted when the JavaScript code makes a call to console.timeStamp. For the list of metrics see page.metrics.
Remarks:
Contains an object with two properties:
title: the title passed to console.timeStamp - metrics: object containing metrics as key/value pairs. The values will be numbers.PageError
</td><td>"pageerror"
Emitted when an uncaught exception happens within the page. Contains an Error or data of type unknown.
Popup
</td><td>"popup"
Emitted when the page opens a new tab or window.
Contains a Page corresponding to the popup window.
</td></tr> <tr><td>Request
</td><td>"request"
Emitted when a page issues a request and contains a HTTPRequest.
Remarks:
The object is readonly. See Page.setRequestInterception() for intercepting and mutating requests.
</td></tr> <tr><td>RequestFailed
</td><td>"requestfailed"
Emitted when a request fails, for example by timing out.
Contains a HTTPRequest.
Remarks:
HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with requestfinished event and not with requestfailed.
RequestFinished
</td><td>"requestfinished"
Emitted when a request finishes successfully. Contains a HTTPRequest.
</td></tr> <tr><td>RequestServedFromCache
</td><td>"requestservedfromcache"
Emitted when a request ended up loading from cache. Contains a HTTPRequest.
Remarks:
For certain requests, might contain undefined. https://crbug.com/750469
</td></tr> <tr><td>Response
</td><td>"response"
Emitted when a response is received. Contains a HTTPResponse.
</td></tr> <tr><td>WorkerCreated
</td><td>"workercreated"
Emitted when a dedicated WebWorker is spawned by the page.
</td></tr> <tr><td>WorkerDestroyed
</td><td>"workerdestroyed"
Emitted when a dedicated WebWorker is destroyed by the page.
</td></tr> </tbody></table>