--- sidebar_label: PageEvent --- # PageEvent enum All the events that a page instance may emit. #### Signature: ```typescript export declare const enum PageEvent ``` ## Enumeration Members
Member Value Description
Close `"close"` Emitted when the page closes.
Console `"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](./puppeteer.consolemessage.md) representing the console message that was logged.
Dialog `"dialog"` Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Puppeteer can respond to the dialog via [Dialog.accept()](./puppeteer.dialog.accept.md) or [Dialog.dismiss()](./puppeteer.dialog.dismiss.md).
DOMContentLoaded `"domcontentloaded"` Emitted when the JavaScript [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
Error `"error"` Emitted when the page crashes. Will contain an `Error`.
FrameAttached `"frameattached"` Emitted when a frame is attached. Will contain a [Frame](./puppeteer.frame.md).
FrameDetached `"framedetached"` Emitted when a frame is detached. Will contain a [Frame](./puppeteer.frame.md).
FrameNavigated `"framenavigated"` Emitted when a frame is navigated to a new URL. Will contain a [Frame](./puppeteer.frame.md).
Load `"load"` Emitted when the JavaScript [load](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched.
Metrics `"metrics"` Emitted when the JavaScript code makes a call to `console.timeStamp`. For the list of metrics see [page.metrics](./puppeteer.page.metrics.md). **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 `number`s.
PageError `"pageerror"` Emitted when an uncaught exception happens within the page. Contains an `Error`.
Popup `"popup"` Emitted when the page opens a new tab or window. Contains a [Page](./puppeteer.page.md) corresponding to the popup window.
Request `"request"` Emitted when a page issues a request and contains a [HTTPRequest](./puppeteer.httprequest.md). **Remarks:** The object is readonly. See [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md) for intercepting and mutating requests.
RequestFailed `"requestfailed"` Emitted when a request fails, for example by timing out. Contains a [HTTPRequest](./puppeteer.httprequest.md). **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 `"requestfinished"` Emitted when a request finishes successfully. Contains a [HTTPRequest](./puppeteer.httprequest.md).
RequestServedFromCache `"requestservedfromcache"` Emitted when a request ended up loading from cache. Contains a [HTTPRequest](./puppeteer.httprequest.md). **Remarks:** For certain requests, might contain undefined. [https://crbug.com/750469](https://crbug.com/750469)
Response `"response"` Emitted when a response is received. Contains a [HTTPResponse](./puppeteer.httpresponse.md).
WorkerCreated `"workercreated"` Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the page.
WorkerDestroyed `"workerdestroyed"` Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is destroyed by the page.