2022-08-06 14:49:20 +00:00
|
|
|
---
|
|
|
|
sidebar_label: Page.once
|
|
|
|
---
|
|
|
|
|
|
|
|
# Page.once() method
|
|
|
|
|
2022-10-24 14:31:12 +00:00
|
|
|
#### Signature:
|
2022-08-06 14:49:20 +00:00
|
|
|
|
|
|
|
```typescript
|
|
|
|
class Page {
|
|
|
|
once<K extends keyof PageEventObject>(
|
|
|
|
eventName: K,
|
|
|
|
handler: (event: PageEventObject[K]) => void
|
2023-05-31 13:09:47 +00:00
|
|
|
): this;
|
2022-08-06 14:49:20 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --------- | -------------------------------------------------------------------------- | ----------- |
|
|
|
|
| eventName | K | |
|
|
|
|
| handler | (event: [PageEventObject](./puppeteer.pageeventobject.md)\[K\]) => void | |
|
|
|
|
|
|
|
|
**Returns:**
|
|
|
|
|
2023-05-31 13:09:47 +00:00
|
|
|
this
|