# Changelog

Combined changelog for puppeteer and puppeteer-core.

## [24.19.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.18.0...puppeteer-v24.19.0) (2025-09-04)

### Features

- roll to Chrome 140.0.7339.80 ([#14162](https://github.com/puppeteer/puppeteer/issues/14162)) ([0cb425b](https://github.com/puppeteer/puppeteer/commit/0cb425b442258433798f58bd162812903d520127))

### Bug Fixes

- accessibility SerializedAXNode.elementHandle returns the parent's handle for text nodes ([#14159](https://github.com/puppeteer/puppeteer/issues/14159)) ([0cb49fd](https://github.com/puppeteer/puppeteer/commit/0cb49fdbada8612230dc71a8625bfc073d6b9caf))
- throw on history entry not found ([#14160](https://github.com/puppeteer/puppeteer/issues/14160)) ([f660ef8](https://github.com/puppeteer/puppeteer/commit/f660ef8e520c9d2356df6aee7d7b01b7f9882016))
- **webdriver:** support interception after continueWithAuth ([#14167](https://github.com/puppeteer/puppeteer/issues/14167)) ([21f1eb5](https://github.com/puppeteer/puppeteer/commit/21f1eb58d7274a72b2e0c0de1f36d3889ba001c1))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.18.0 to 24.19.0

## [24.18.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.17.1...puppeteer-v24.18.0) (2025-09-01)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.17.1 to 24.18.0

### Features

- support converting ElementHandle to Locator ([#14150](https://github.com/puppeteer/puppeteer/issues/14150)) ([da95fb0](https://github.com/puppeteer/puppeteer/commit/da95fb039fed12d43bbce05c1718efd35aae5c83))

### Bug Fixes

- update CSP message check ([#14156](https://github.com/puppeteer/puppeteer/issues/14156)) ([41e39c7](https://github.com/puppeteer/puppeteer/commit/41e39c77987b5186f11b59296ebd5e9347efcd09))

## [24.17.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.17.0...puppeteer-v24.17.1) (2025-08-28)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.7 to 2.10.8

### Bug Fixes

- add better stack trace to LifecycleWatcher ([#14137](https://github.com/puppeteer/puppeteer/issues/14137)) ([0c9fd4f](https://github.com/puppeteer/puppeteer/commit/0c9fd4f0d188842a04682561270ea7c91402dca2))
- roll to Chrome 139.0.7258.154 ([#14144](https://github.com/puppeteer/puppeteer/issues/14144)) ([51033e3](https://github.com/puppeteer/puppeteer/commit/51033e358a8bd65eb7aa2b3379d0a9ec12d50859))
- roll to Firefox 142.0.1 ([#14145](https://github.com/puppeteer/puppeteer/issues/14145)) ([b321cd0](https://github.com/puppeteer/puppeteer/commit/b321cd0c8bf7d4c4b9c618dbab49ad39c8d89cfe))
- standardize error handling for closed connections ([#14135](https://github.com/puppeteer/puppeteer/issues/14135)) ([d4478a1](https://github.com/puppeteer/puppeteer/commit/d4478a127db373645a6960527e495aa52457c42e))

## [24.17.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.16.2...puppeteer-v24.17.0) (2025-08-20)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.6 to 2.10.7

### Features

- roll to Firefox 142.0 ([#14127](https://github.com/puppeteer/puppeteer/issues/14127)) ([f00517e](https://github.com/puppeteer/puppeteer/commit/f00517ef4aad3ccfd9afb2e00114baa13ea71cc4))
- **webdriver:** implement `Page.setJavaScriptEnabled` ([#14118](https://github.com/puppeteer/puppeteer/issues/14118)) ([fb55e8f](https://github.com/puppeteer/puppeteer/commit/fb55e8fe26aa6be6ed7edb235f5914d0bab641c3))

### Bug Fixes

- roll to Chrome 139.0.7258.138 ([#14125](https://github.com/puppeteer/puppeteer/issues/14125)) ([b1d2a54](https://github.com/puppeteer/puppeteer/commit/b1d2a541815bd0010039ab1f8f269865ce5897be))

## [24.16.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.16.1...puppeteer-v24.16.2) (2025-08-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.16.1 to 24.16.2

### Bug Fixes

- report a helpful error if waiting fails ([#14104](https://github.com/puppeteer/puppeteer/issues/14104)) ([21de026](https://github.com/puppeteer/puppeteer/commit/21de0262c774e0a21b5931bd10ce2ca5dc3df574))
- roll to Chrome 139.0.7258.68 ([#14106](https://github.com/puppeteer/puppeteer/issues/14106)) ([6d12c61](https://github.com/puppeteer/puppeteer/commit/6d12c61a69ec8bb421664889babd251f36062082))

## [24.16.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.16.0...puppeteer-v24.16.1) (2025-08-10)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.16.0 to 24.16.1

### Bug Fixes

- roll to Firefox 141.0.3 ([#14097](https://github.com/puppeteer/puppeteer/issues/14097)) ([a25cf76](https://github.com/puppeteer/puppeteer/commit/a25cf76add045dc4bc2ee9df8d25faa9322a5391))

## [24.16.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.15.0...puppeteer-v24.16.0) (2025-08-06)

### Features

- roll to Chrome 139.0.7258.66 ([#14085](https://github.com/puppeteer/puppeteer/issues/14085)) ([65c18f4](https://github.com/puppeteer/puppeteer/commit/65c18f4f2876806cb6e086d568a0011f890fd945))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.15.0 to 24.16.0

### Bug Fixes

- roll to Chrome 138.0.7204.183 ([#14065](https://github.com/puppeteer/puppeteer/issues/14065)) ([910b37f](https://github.com/puppeteer/puppeteer/commit/910b37fbaeff62a672ef45f6e778abca0a6392b4))
- roll to Firefox 141.0.2 ([#14089](https://github.com/puppeteer/puppeteer/issues/14089)) ([5d3372e](https://github.com/puppeteer/puppeteer/commit/5d3372e2a11d8676790b7693ebd39ac2c8781954))

## [24.15.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.14.0...puppeteer-v24.15.0) (2025-07-23)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.14.0 to 24.15.0

### Features

- emulateTimezone via BiDi ([#14042](https://github.com/puppeteer/puppeteer/issues/14042)) ([e8768c9](https://github.com/puppeteer/puppeteer/commit/e8768c9b2b21c077ba0cf503c69e27f72868c20a))
- roll to Firefox 141.0 ([#14048](https://github.com/puppeteer/puppeteer/issues/14048)) ([f8853de](https://github.com/puppeteer/puppeteer/commit/f8853de69677c22a1cf3d4b3de55af3a1be85105))

### Bug Fixes

- roll to Chrome 138.0.7204.168 ([#14047](https://github.com/puppeteer/puppeteer/issues/14047)) ([4a89e96](https://github.com/puppeteer/puppeteer/commit/4a89e966554727950cdc1cc88146e2a6a733bc88))

## [24.14.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.13.0...puppeteer-v24.14.0) (2025-07-16)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.5 to 2.10.6

### Features

- add debugging highlight to ElementHandle.click() ([#14024](https://github.com/puppeteer/puppeteer/issues/14024)) ([8c4d87a](https://github.com/puppeteer/puppeteer/commit/8c4d87af17aceb0a25aecc85819f4258f717b944))

### Bug Fixes

- roll to Chrome 138.0.7204.157 ([#14029](https://github.com/puppeteer/puppeteer/issues/14029)) ([2a733b4](https://github.com/puppeteer/puppeteer/commit/2a733b401f688ea1e74b0e8af65c7399021db1ea))
- **webdriver:** provide proper exception while accessing response in BiDi ([#14031](https://github.com/puppeteer/puppeteer/issues/14031)) ([9150473](https://github.com/puppeteer/puppeteer/commit/915047341b779a580be07552d853c88c6b306603))

## [24.13.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.12.1...puppeteer-v24.13.0) (2025-07-14)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.12.1 to 24.13.0

### Features

- respect `proxyServer` in incognito browser context in BiDi ([#14013](https://github.com/puppeteer/puppeteer/issues/14013)) ([1559ee4](https://github.com/puppeteer/puppeteer/commit/1559ee4cafb96afb637609de5f3fc63e3e1e60ad))
- **webdriver:** support network response content in BiDi ([#14016](https://github.com/puppeteer/puppeteer/issues/14016)) ([b4d4d19](https://github.com/puppeteer/puppeteer/commit/b4d4d1915f729a2760a8c74b50877d92ce5e1c94))

### Bug Fixes

- ignore errors caused by worker targets that do not support network conditions ([#14015](https://github.com/puppeteer/puppeteer/issues/14015)) ([d012588](https://github.com/puppeteer/puppeteer/commit/d012588b7a3fe649b0919ec14d0878390433cf6b))

## [24.12.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.12.0...puppeteer-v24.12.1) (2025-07-09)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.12.0 to 24.12.1

### Bug Fixes

- make sure pipe transport dispatches messages in tasks ([#14009](https://github.com/puppeteer/puppeteer/issues/14009)) ([b52ad4c](https://github.com/puppeteer/puppeteer/commit/b52ad4ccb52235ce253f84fb8105edc74971f5ef))
- roll to Chrome 138.0.7204.94 ([#14003](https://github.com/puppeteer/puppeteer/issues/14003)) ([7140ffa](https://github.com/puppeteer/puppeteer/commit/7140ffae116874cf9f407970cee13243aa10aac3))
- roll to Firefox 140.0.4 ([#14006](https://github.com/puppeteer/puppeteer/issues/14006)) ([5887283](https://github.com/puppeteer/puppeteer/commit/5887283f384cea366f188e662614266cbf05f3e1))
- waitForNetwork idle timer resetting on new request changes ([#14005](https://github.com/puppeteer/puppeteer/issues/14005)) ([5745098](https://github.com/puppeteer/puppeteer/commit/57450983c4fa98ea701b6376ee812fb8d533bb03))

## [24.12.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.11.2...puppeteer-v24.12.0) (2025-07-07)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.11.2 to 24.12.0

### Features

- allow turning off network events ([#13901](https://github.com/puppeteer/puppeteer/issues/13901)) ([0dddb1d](https://github.com/puppeteer/puppeteer/commit/0dddb1d403374e96f8e95d6d95d0dedd49ef02fe))

### Bug Fixes

- handle clicks on partially offscreen elements ([#13991](https://github.com/puppeteer/puppeteer/issues/13991)) ([6bb84bb](https://github.com/puppeteer/puppeteer/commit/6bb84bb81683e3ed934e86de0d163f86b6847d38))

## [24.11.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.11.1...puppeteer-v24.11.2) (2025-07-01)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.11.1 to 24.11.2

### Bug Fixes

- roll to Chrome 138.0.7204.92 ([#13989](https://github.com/puppeteer/puppeteer/issues/13989)) ([f1a585d](https://github.com/puppeteer/puppeteer/commit/f1a585de8da9658a8259a0a0e255297ce0dd0493))

## [24.11.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.11.0...puppeteer-v24.11.1) (2025-06-28)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.11.0 to 24.11.1

### Bug Fixes

- roll to Firefox 140.0.1 ([#13971](https://github.com/puppeteer/puppeteer/issues/13971)) ([34137ce](https://github.com/puppeteer/puppeteer/commit/34137ced33cb5ec75c28f482aad9bf0b77474114))
- roll to Firefox 140.0.2 ([#13979](https://github.com/puppeteer/puppeteer/issues/13979)) ([956e13d](https://github.com/puppeteer/puppeteer/commit/956e13d6ce72af580a9357f0e849a4de21110072))

## [24.11.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.10.2...puppeteer-v24.11.0) (2025-06-26)

### Features

- roll to Chrome 138.0.7204.49 ([#13968](https://github.com/puppeteer/puppeteer/issues/13968)) ([0e046ee](https://github.com/puppeteer/puppeteer/commit/0e046ee709470b8c319831e1ff76c9f50142cf4d))
- roll to Firefox 140.0 ([#13967](https://github.com/puppeteer/puppeteer/issues/13967)) ([7829b5b](https://github.com/puppeteer/puppeteer/commit/7829b5b876b2a9bd3bbb9137b75eebff2830869d))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.10.2 to 24.11.0

## [24.10.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.10.1...puppeteer-v24.10.2) (2025-06-18)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.10.1 to 24.10.2

### Bug Fixes

- correctly conver referrerPolicy to protocol value ([#13954](https://github.com/puppeteer/puppeteer/issues/13954)) ([67ad01f](https://github.com/puppeteer/puppeteer/commit/67ad01fd9ee9f6a8948439d470bf7f2b5b0d47fa))
- handle target close errors in NetworkManager ([#13946](https://github.com/puppeteer/puppeteer/issues/13946)) ([cd87b53](https://github.com/puppeteer/puppeteer/commit/cd87b533b4488fbbe98eee224ae5e197c0771efb))
- roll to Chrome 137.0.7151.119 ([#13953](https://github.com/puppeteer/puppeteer/issues/13953)) ([14a61d6](https://github.com/puppeteer/puppeteer/commit/14a61d6e47b86d2823b41f53f76cfe0197594706))

## [24.10.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.10.0...puppeteer-v24.10.1) (2025-06-11)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.10.0 to 24.10.1

### Bug Fixes

- roll to Chrome 137.0.7151.68 ([#13918](https://github.com/puppeteer/puppeteer/issues/13918)) ([7ae67cd](https://github.com/puppeteer/puppeteer/commit/7ae67cddacd1dfb725555ee6d1966573e806d865))
- roll to Chrome 137.0.7151.70 ([#13933](https://github.com/puppeteer/puppeteer/issues/13933)) ([c36440d](https://github.com/puppeteer/puppeteer/commit/c36440de3a7da1f2bb8cbbd3525ac170245b9b45))
- roll to Firefox 139.0.4 ([#13934](https://github.com/puppeteer/puppeteer/issues/13934)) ([f651af3](https://github.com/puppeteer/puppeteer/commit/f651af3b238bede0ca50c87a3712588cace3c178))

## [24.10.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.9.0...puppeteer-v24.10.0) (2025-06-02)

### Features

- roll to Chrome 137.0.7151.55 ([#13909](https://github.com/puppeteer/puppeteer/issues/13909)) ([1e5a1a8](https://github.com/puppeteer/puppeteer/commit/1e5a1a825166d49aec5c1e8205874ebeeb6c813c))
- roll to Firefox 139.0 ([#13908](https://github.com/puppeteer/puppeteer/issues/13908)) ([4bd8319](https://github.com/puppeteer/puppeteer/commit/4bd83192c102ee2d2253604f0089c0ba8db51d27))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.9.0 to 24.10.0

### Bug Fixes

- roll to Chrome 136.0.7103.113 ([#13895](https://github.com/puppeteer/puppeteer/issues/13895)) ([a6b61e7](https://github.com/puppeteer/puppeteer/commit/a6b61e799a0bb2a6fe3c87a5bdbb09f17808f514))
- roll to Firefox 139.0.1 ([#13911](https://github.com/puppeteer/puppeteer/issues/13911)) ([646a961](https://github.com/puppeteer/puppeteer/commit/646a961982b6180eaaacf95e3cb5433f7ff40a8e))
- switch to global command id generation ([#13910](https://github.com/puppeteer/puppeteer/issues/13910)) ([c2ebd3f](https://github.com/puppeteer/puppeteer/commit/c2ebd3f7fa2dd0863a1129529865bb8502a4e604))

## [24.9.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.8.2...puppeteer-v24.9.0) (2025-05-20)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.4 to 2.10.5

### Features

- add `screencast` override options ([#13708](https://github.com/puppeteer/puppeteer/issues/13708)) ([e3586e8](https://github.com/puppeteer/puppeteer/commit/e3586e81521e0d91d4d69990cc44a73504dea3c4))

### Bug Fixes

- roll to Chrome 136.0.7103.94 ([#13870](https://github.com/puppeteer/puppeteer/issues/13870)) ([9c6ef13](https://github.com/puppeteer/puppeteer/commit/9c6ef1345633b3576b3ef433dafdc6dcb9c1424f))
- roll to Firefox 138.0.3 ([#13868](https://github.com/puppeteer/puppeteer/issues/13868)) ([863a3e0](https://github.com/puppeteer/puppeteer/commit/863a3e07dcce874035d851778ae4187e12ef421b))
- roll to Firefox 138.0.4 ([#13881](https://github.com/puppeteer/puppeteer/issues/13881)) ([29ff2b5](https://github.com/puppeteer/puppeteer/commit/29ff2b59815c543c95e7458b7f8ba7ad72afd71c))

## [24.8.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.8.1...puppeteer-v24.8.2) (2025-05-07)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.3 to 2.10.4

### Bug Fixes

- roll to Chrome 136.0.7103.92 ([#13854](https://github.com/puppeteer/puppeteer/issues/13854)) ([a83e6ce](https://github.com/puppeteer/puppeteer/commit/a83e6ce79729a99a4d7c8eb834aa645869185664))

## [24.8.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.8.0...puppeteer-v24.8.1) (2025-05-06)

### Bug Fixes

- revert "refactor: allow importing chromium-bidi ESM" ([#13849](https://github.com/puppeteer/puppeteer/issues/13849)) ([e7f514a](https://github.com/puppeteer/puppeteer/commit/e7f514ab5a55ffed015cd89bc69feb059bf5da0c))
- **webdriver:** bump chromium-bidi ([#13844](https://github.com/puppeteer/puppeteer/issues/13844)) ([250cccb](https://github.com/puppeteer/puppeteer/commit/250cccb57a4fd61ad92c5f54ae09e59ea87ec27d))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.8.0 to 24.8.1

## [24.8.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.7.2...puppeteer-v24.8.0) (2025-05-02)

### Features

- Add `enableExtensions` launch option ([#13824](https://github.com/puppeteer/puppeteer/issues/13824)) ([fd948cf](https://github.com/puppeteer/puppeteer/commit/fd948cfd9dece93233b8ed636af1447f8fb44f4e))
- Add Browser.installExtension and Browser.uninstallExtension ([#13810](https://github.com/puppeteer/puppeteer/issues/13810)) ([7b9c72c](https://github.com/puppeteer/puppeteer/commit/7b9c72c984ba14b78d94235bd3ac41e0848a96a0))
- roll to Chrome 136.0.7103.49 ([#13828](https://github.com/puppeteer/puppeteer/issues/13828)) ([ad4a6e7](https://github.com/puppeteer/puppeteer/commit/ad4a6e76c6846d98d9f6c4e81cbab71c4284a124))
- roll to Firefox 138.0 ([#13829](https://github.com/puppeteer/puppeteer/issues/13829)) ([b3f04d7](https://github.com/puppeteer/puppeteer/commit/b3f04d7e65319d61f88d04f74d215c452292e222))

### Bug Fixes

- roll to Firefox 138.0.1 ([#13832](https://github.com/puppeteer/puppeteer/issues/13832)) ([bfa0e39](https://github.com/puppeteer/puppeteer/commit/bfa0e39a3bdee567e0df87d65d76494139c3a18c))
- writable stream in PipeTransport should handle errors ([#13825](https://github.com/puppeteer/puppeteer/issues/13825)) ([da97da5](https://github.com/puppeteer/puppeteer/commit/da97da5731a7d246118c74d69baea23eeaf3a7f6))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.2 to 2.10.3

## [24.7.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.7.1...puppeteer-v24.7.2) (2025-04-24)

### Bug Fixes

- roll to Chrome 135.0.7049.114 ([#13811](https://github.com/puppeteer/puppeteer/issues/13811)) ([3d32f72](https://github.com/puppeteer/puppeteer/commit/3d32f7232de1d67a23e73ed1119b95ba397b379f))
- roll to Chrome 135.0.7049.97 ([#13802](https://github.com/puppeteer/puppeteer/issues/13802)) ([d0e6492](https://github.com/puppeteer/puppeteer/commit/d0e649266b244ae3ec153e62f05b40ce819f7049))
- update chromium-bidi to fix ESM import issue ([#13813](https://github.com/puppeteer/puppeteer/issues/13813)) ([7ff0719](https://github.com/puppeteer/puppeteer/commit/7ff07196a263a39cf03011aa00c41728d272bbb7))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.7.1 to 24.7.2

## [24.7.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.7.0...puppeteer-v24.7.1) (2025-04-22)

### Bug Fixes

- update Disposable polyfill to match TC39 proposal ([#13683](https://github.com/puppeteer/puppeteer/issues/13683)) ([c2b27c4](https://github.com/puppeteer/puppeteer/commit/c2b27c4b2609fb52f0937d34fb55418d4c046fd4))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.1 to 2.10.2

## [24.7.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.6.1...puppeteer-v24.7.0) (2025-04-22)

### Bug Fixes

- roll to Chrome 135.0.7049.95 ([#13788](https://github.com/puppeteer/puppeteer/issues/13788)) ([f2f37b5](https://github.com/puppeteer/puppeteer/commit/f2f37b5a3cbfba9a0279f6ff47a424170575ed3c))
- roll to Firefox 137.0.2 ([#13789](https://github.com/puppeteer/puppeteer/issues/13789)) ([192ce96](https://github.com/puppeteer/puppeteer/commit/192ce9676c312c551b24cd732c15b590c5243fb6))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.10.0 to 2.10.1

### Features

- support network requests for workers ([#13752](https://github.com/puppeteer/puppeteer/issues/13752)) ([4062068](https://github.com/puppeteer/puppeteer/commit/4062068da9fd839008ef78411432de26ad367bda))
- **webdriver:** support FileChooser with WebDriver BiDi ([#13780](https://github.com/puppeteer/puppeteer/issues/13780)) ([a4d0d34](https://github.com/puppeteer/puppeteer/commit/a4d0d34643ef1dce173a0a927a4016ee99521ac4))
- **webdriver:** support geolocation emulation ([#13773](https://github.com/puppeteer/puppeteer/issues/13773)) ([74eefd8](https://github.com/puppeteer/puppeteer/commit/74eefd82786e6b2b59d4d8ef6989404536d3463f))

## [24.6.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.6.0...puppeteer-v24.6.1) (2025-04-09)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.9.0 to 2.10.0

### Bug Fixes

- optimize base64 decoding ([#13753](https://github.com/puppeteer/puppeteer/issues/13753)) ([8145dd6](https://github.com/puppeteer/puppeteer/commit/8145dd64f21ca7ab917c9c75fe51d04a9463b552))
- roll to Chrome 135.0.7049.84 ([#13756](https://github.com/puppeteer/puppeteer/issues/13756)) ([ab6459f](https://github.com/puppeteer/puppeteer/commit/ab6459f947471645445a71afbe5d7b4755cb9cf7))
- roll to Firefox 137.0.1 ([#13758](https://github.com/puppeteer/puppeteer/issues/13758)) ([446a07c](https://github.com/puppeteer/puppeteer/commit/446a07cdc4e56f8a926f74d167cb14eca24a9602))
- **webdriver:** handle errors if exposed function args are no longer available ([#13759](https://github.com/puppeteer/puppeteer/issues/13759)) ([4013556](https://github.com/puppeteer/puppeteer/commit/401355610874beac23a51dcb75739a4bb4191a2b))

## [24.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.5.0...puppeteer-v24.6.0) (2025-04-03)

### Features

- roll to Chrome 135.0.7049.42 ([#13717](https://github.com/puppeteer/puppeteer/issues/13717)) ([30b7ba8](https://github.com/puppeteer/puppeteer/commit/30b7ba8c62d3b76efed239b5bd39ec4bfc77bd08))
- roll to Firefox 137.0 ([#13720](https://github.com/puppeteer/puppeteer/issues/13720)) ([bee835f](https://github.com/puppeteer/puppeteer/commit/bee835f938b8ace30d5a06f17bd4a5ff0923ad16))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.5.0 to 24.6.0

## [24.5.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.4.0...puppeteer-v24.5.0) (2025-03-31)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.8.0 to 2.9.0

### Features

- improve `screencast` options ([#13645](https://github.com/puppeteer/puppeteer/issues/13645)) ([22aeab9](https://github.com/puppeteer/puppeteer/commit/22aeab945842fb1875e28da672c28bcca166254a))

### Bug Fixes

- `screencast` mp4 encoding ([#13676](https://github.com/puppeteer/puppeteer/issues/13676)) ([dfc9219](https://github.com/puppeteer/puppeteer/commit/dfc92194c5f2656de7374cafcb73cd283a0976c8))
- roll to Chrome 134.0.6998.165 ([#13696](https://github.com/puppeteer/puppeteer/issues/13696)) ([ff74c58](https://github.com/puppeteer/puppeteer/commit/ff74c58464f985253b0a986f5fbbe4edc1658a42))
- roll to Chrome 134.0.6998.88 ([#13666](https://github.com/puppeteer/puppeteer/issues/13666)) ([334d06a](https://github.com/puppeteer/puppeteer/commit/334d06aa546173b924a4754c8968470547cd75a7))
- roll to Chrome 134.0.6998.90 ([#13693](https://github.com/puppeteer/puppeteer/issues/13693)) ([7433674](https://github.com/puppeteer/puppeteer/commit/7433674f69100128f2a7fe5450e5315a3380b865))
- roll to Firefox 136.0.1 ([#13672](https://github.com/puppeteer/puppeteer/issues/13672)) ([c900ded](https://github.com/puppeteer/puppeteer/commit/c900ded5125069e9abf796877d4003cdf0392fa9))
- roll to Firefox 136.0.2 ([#13692](https://github.com/puppeteer/puppeteer/issues/13692)) ([ea8a0ae](https://github.com/puppeteer/puppeteer/commit/ea8a0aee6136a585ee9e9ebe94e1e766144082e8))
- roll to Firefox 136.0.3 ([#13702](https://github.com/puppeteer/puppeteer/issues/13702)) ([d3a865e](https://github.com/puppeteer/puppeteer/commit/d3a865e4fd742d9b025b8de988a2635e0ca1516d))
- roll to Firefox 136.0.4 ([#13707](https://github.com/puppeteer/puppeteer/issues/13707)) ([33668c9](https://github.com/puppeteer/puppeteer/commit/33668c983a08f0fedf8f9f85e2f8a71c7a2780f2))

## [24.4.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.3.1...puppeteer-v24.4.0) (2025-03-05)

### Features

- roll to Chrome 134.0.6998.35 ([#13649](https://github.com/puppeteer/puppeteer/issues/13649)) ([cdb175b](https://github.com/puppeteer/puppeteer/commit/cdb175b76c49c53e680515cf635f08e722f3dd52))
- roll to Firefox 136.0 ([#13647](https://github.com/puppeteer/puppeteer/issues/13647)) ([b8e0310](https://github.com/puppeteer/puppeteer/commit/b8e031007a5b980d59b8e17bc208f18f55050442))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.7.1 to 2.8.0

## [24.3.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.3.0...puppeteer-v24.3.1) (2025-03-03)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.3.0 to 24.3.1

### Bug Fixes

- roll to Chrome 133.0.6943.141 ([#13635](https://github.com/puppeteer/puppeteer/issues/13635)) ([af6ee5d](https://github.com/puppeteer/puppeteer/commit/af6ee5ddf4a7a8bf471d3aafc2366bec7a834de5))

## [24.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.2.1...puppeteer-v24.3.0) (2025-02-24)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.2.1 to 24.3.0

### Features

- expose CDPSession.detached ([#13615](https://github.com/puppeteer/puppeteer/issues/13615)) ([33e3e83](https://github.com/puppeteer/puppeteer/commit/33e3e83d3c47e1fcedbbec186ae3ab98ae7cf025))

### Bug Fixes

- do not throw an error when a navigation is aborted ([#13621](https://github.com/puppeteer/puppeteer/issues/13621)) ([89d71a2](https://github.com/puppeteer/puppeteer/commit/89d71a2f8f4bd681a265d06431d00757ba891efa))
- roll to Chrome 133.0.6943.126 ([#13623](https://github.com/puppeteer/puppeteer/issues/13623)) ([09e4404](https://github.com/puppeteer/puppeteer/commit/09e44049baee33e2ed660fe224c2035b2892b413))
- roll to Firefox 135.0.1 ([#13622](https://github.com/puppeteer/puppeteer/issues/13622)) ([ce10410](https://github.com/puppeteer/puppeteer/commit/ce10410f0a9603ad9bffae8faad8da70f7383262))

## [24.2.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.2.0...puppeteer-v24.2.1) (2025-02-13)

### Bug Fixes

- change Browser.setCookie type to be CookieData ([#13593](https://github.com/puppeteer/puppeteer/issues/13593)) ([8971cc2](https://github.com/puppeteer/puppeteer/commit/8971cc21ce52ded6cb3c973467fff0319b3f0c95))
- don't wait for activation if the connection is disconnected ([#13591](https://github.com/puppeteer/puppeteer/issues/13591)) ([6b20ac1](https://github.com/puppeteer/puppeteer/commit/6b20ac10b1cc6a54a87eb2f6437727d204acd1c3))
- **network:** propagate CDP error in interception ([#13607](https://github.com/puppeteer/puppeteer/issues/13607)) ([2f470cd](https://github.com/puppeteer/puppeteer/commit/2f470cdeddbdae6eb110445acfff011af151ca1d))
- roll to Chrome 133.0.6943.98 ([#13611](https://github.com/puppeteer/puppeteer/issues/13611)) ([ea11a46](https://github.com/puppeteer/puppeteer/commit/ea11a464460735048cf0e9dc81b28779e39e2e01))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.2.0 to 24.2.1

## [24.2.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.1.1...puppeteer-v24.2.0) (2025-02-05)

### Features

- add keyboard-lock and pointer-lock permissions ([#13586](https://github.com/puppeteer/puppeteer/issues/13586)) ([108cd53](https://github.com/puppeteer/puppeteer/commit/108cd53c21ec31b2383de11510bfbedfacdd5ac2))
- roll to Chrome 133.0.6943.53 ([#13584](https://github.com/puppeteer/puppeteer/issues/13584)) ([a63d568](https://github.com/puppeteer/puppeteer/commit/a63d5686cbfef782f2e079ce344503ff88c0bb9b))
- roll to Firefox 135.0 ([#13587](https://github.com/puppeteer/puppeteer/issues/13587)) ([b42c046](https://github.com/puppeteer/puppeteer/commit/b42c0464aa0d8a102856e147d34a1fb048f547c9))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.7.0 to 2.7.1

### Bug Fixes

- roll to Chrome 132.0.6834.159 ([#13566](https://github.com/puppeteer/puppeteer/issues/13566)) ([416534b](https://github.com/puppeteer/puppeteer/commit/416534bce9575f65b81487e8820e8a3c96fb9b10))
- **webdriver:** make sure user agent can be set twice ([#13585](https://github.com/puppeteer/puppeteer/issues/13585)) ([411ff95](https://github.com/puppeteer/puppeteer/commit/411ff9510add6ea33fe004036e61a7032fd30de1))

## [24.1.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.1.0...puppeteer-v24.1.1) (2025-01-23)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.1.0 to 24.1.1

### Bug Fixes

- dispose the isolated handle ([#13542](https://github.com/puppeteer/puppeteer/issues/13542)) ([f9ed75e](https://github.com/puppeteer/puppeteer/commit/f9ed75eb39eef825469b82a818b245bc76d6cd93))
- roll to Chrome 132.0.6834.110 ([#13543](https://github.com/puppeteer/puppeteer/issues/13543)) ([2d2d214](https://github.com/puppeteer/puppeteer/commit/2d2d21483c608e67e848586f912403689863c8e2))
- roll to Firefox 134.0.2 ([#13538](https://github.com/puppeteer/puppeteer/issues/13538)) ([82ec05d](https://github.com/puppeteer/puppeteer/commit/82ec05d3fcb8ed4be2ccae622ff1ad6c35e00c39))
- **webdriver:** use correct units for format pdf option ([#13516](https://github.com/puppeteer/puppeteer/issues/13516)) ([c764f82](https://github.com/puppeteer/puppeteer/commit/c764f82c7435bdc10e6a9007892ab8dba111d21c))

## [24.1.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.0.0...puppeteer-v24.1.0) (2025-01-15)

### Features

- roll to Chrome 132.0.6834.83 ([#13507](https://github.com/puppeteer/puppeteer/issues/13507)) ([e282992](https://github.com/puppeteer/puppeteer/commit/e28299296675c018e38b0367c3e9810a8a63f21c))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 24.0.0 to 24.1.0

### Bug Fixes

- roll to Firefox 134.0.1 ([#13510](https://github.com/puppeteer/puppeteer/issues/13510)) ([a50357c](https://github.com/puppeteer/puppeteer/commit/a50357cc2c84f59f951bc647ac809303d365231a))

## [24.0.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.11.1...puppeteer-v24.0.0) (2025-01-09)

### Bug Fixes

- include URL fragment into URL returned by HTTPRequest/Response instances ([#13425](https://github.com/puppeteer/puppeteer/issues/13425)) ([8ff26ad](https://github.com/puppeteer/puppeteer/commit/8ff26ad5aff0b366e54e6e85f71577de575ee31d))
- remove erroneous changelog entry ([#13479](https://github.com/puppeteer/puppeteer/issues/13479)) ([6de3238](https://github.com/puppeteer/puppeteer/commit/6de32386c2294a74eb3df3fbc9b179ffeed083f5))
- roll to Chrome 131.0.6778.264 ([#13468](https://github.com/puppeteer/puppeteer/issues/13468)) ([aac759b](https://github.com/puppeteer/puppeteer/commit/aac759b82f0f6427b401bee11ab7c454f0ac6d5b))
- **webdriver:** handle DiscardedBrowsingContextError error ([#13472](https://github.com/puppeteer/puppeteer/issues/13472)) ([b903856](https://github.com/puppeteer/puppeteer/commit/b90385662a7b29e9d36a7cae825e8c0f9f89fac8))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.6.1 to 2.7.0

### ⚠ BREAKING CHANGES

- remove support for Firefox over CDP ([#13427](https://github.com/puppeteer/puppeteer/issues/13427))
- remove deprecated Launch and Connect options ([#13426](https://github.com/puppeteer/puppeteer/issues/13426))
- include URL fragment into URL returned by HTTPRequest/Response instances ([#13425](https://github.com/puppeteer/puppeteer/issues/13425))

### Features

- roll to Firefox 134.0 ([#13470](https://github.com/puppeteer/puppeteer/issues/13470)) ([3bd3176](https://github.com/puppeteer/puppeteer/commit/3bd31769b5827305dc553cd36ca40387558b3acd))

### Code Refactoring

- remove deprecated Launch and Connect options ([#13426](https://github.com/puppeteer/puppeteer/issues/13426)) ([20f9f15](https://github.com/puppeteer/puppeteer/commit/20f9f15d5f94832bd6f5c0e9807a1a53182c49f8))
- remove support for Firefox over CDP ([#13427](https://github.com/puppeteer/puppeteer/issues/13427)) ([1a2e91b](https://github.com/puppeteer/puppeteer/commit/1a2e91b04413e2ed90778b2f8e49549a8e63c139))

## [23.11.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.11.0...puppeteer-v23.11.1) (2024-12-19)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.11.0 to 23.11.1

### Bug Fixes

- roll to Chrome 131.0.6778.204 ([#13422](https://github.com/puppeteer/puppeteer/issues/13422)) ([4f3a877](https://github.com/puppeteer/puppeteer/commit/4f3a87789ea271993d418e0e64c6d4e3c940c83b))

## [23.11.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.10.4...puppeteer-v23.11.0) (2024-12-18)

### Bug Fixes

- **deps:** bump chromium-bidi to 0.11.0 ([#13418](https://github.com/puppeteer/puppeteer/issues/13418)) ([771e4b2](https://github.com/puppeteer/puppeteer/commit/771e4b27abf21436dba80d568b82c9235bfb7de3))
- include iframes into the a11y snapshot ([#12579](https://github.com/puppeteer/puppeteer/issues/12579)) ([a8152d4](https://github.com/puppeteer/puppeteer/commit/a8152d46101da918962555404e5a580e2696dd60))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.10.4 to 23.11.0

### Features

- support reducedContrast in Page.emulateVisionDeficiency ([#13408](https://github.com/puppeteer/puppeteer/issues/13408)) ([18e3e6a](https://github.com/puppeteer/puppeteer/commit/18e3e6a42c9517bc3a283fdc23e5c454ad8d27fe))

## [23.10.4](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.10.3...puppeteer-v23.10.4) (2024-12-12)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.10.3 to 23.10.4

### Bug Fixes

- roll to Chrome 131.0.6778.108 ([#13395](https://github.com/puppeteer/puppeteer/issues/13395)) ([cc1aa16](https://github.com/puppeteer/puppeteer/commit/cc1aa167efdb8f229678086618b8b129e7cf96d6))
- roll to Firefox 133.0.3 ([#13399](https://github.com/puppeteer/puppeteer/issues/13399)) ([a163cbf](https://github.com/puppeteer/puppeteer/commit/a163cbf7905059891f68cfe3a31396c9aca64467))

## [23.10.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.10.2...puppeteer-v23.10.3) (2024-12-10)

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.6.0 to 2.6.1

## [23.10.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.10.1...puppeteer-v23.10.2) (2024-12-09)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.5.0 to 2.6.0

### Bug Fixes

- export the PuppeteerLaunchOptions type ([#13376](https://github.com/puppeteer/puppeteer/issues/13376)) ([2202ce8](https://github.com/puppeteer/puppeteer/commit/2202ce8b8a11b6bd36743418ade62b6ae56a67b9))

## [23.10.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.10.0...puppeteer-v23.10.1) (2024-12-04)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.10.0 to 23.10.1

### Bug Fixes

- roll to Chrome 131.0.6778.87 ([#13357](https://github.com/puppeteer/puppeteer/issues/13357)) ([a571bff](https://github.com/puppeteer/puppeteer/commit/a571bff7a47f2e439a59fa1cd94159e8f1b0e1e7))

## [23.10.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.9.0...puppeteer-v23.10.0) (2024-12-03)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.4.1 to 2.5.0

### Features

- adjust browser-level cookie API ([#13331](https://github.com/puppeteer/puppeteer/issues/13331)) ([678eaf0](https://github.com/puppeteer/puppeteer/commit/678eaf09f2f018678181c1b115f850cfa33be411))
- browser level cookies API ([#13316](https://github.com/puppeteer/puppeteer/issues/13316)) ([43dec3b](https://github.com/puppeteer/puppeteer/commit/43dec3b0aa277df0f0b8ed29009d71cd1ba77982))
- implement ElementHandle.backendNodeId ([#13328](https://github.com/puppeteer/puppeteer/issues/13328)) ([ffb31ca](https://github.com/puppeteer/puppeteer/commit/ffb31cacc53f6ca6991b227807a29aa93305a177))
- roll to Firefox 133.0 ([#13333](https://github.com/puppeteer/puppeteer/issues/13333)) ([de314e5](https://github.com/puppeteer/puppeteer/commit/de314e53de38c015748ff4c31f0e178512c4e494))
- support LaunchOptions in executablePath() ([#13340](https://github.com/puppeteer/puppeteer/issues/13340)) ([6acfee6](https://github.com/puppeteer/puppeteer/commit/6acfee6810da378844d4dca7f28d539dd46a3529))

### Bug Fixes

- stop calling bringToFront when taking page screenshots ([#13336](https://github.com/puppeteer/puppeteer/issues/13336)) ([6da2cb4](https://github.com/puppeteer/puppeteer/commit/6da2cb490495193fb7fbdb47a71c95033a4a6fab))

## [23.9.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.8.0...puppeteer-v23.9.0) (2024-11-21)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.8.0 to 23.9.0

### Features

- config download behavior ([#13309](https://github.com/puppeteer/puppeteer/issues/13309)) ([c3ca96c](https://github.com/puppeteer/puppeteer/commit/c3ca96c9d354ea727bfe0954c1ee763ca1ae2a6b))

### Bug Fixes

- correctly resolve OOPIF response bodies ([#13311](https://github.com/puppeteer/puppeteer/issues/13311)) ([e837140](https://github.com/puppeteer/puppeteer/commit/e83714023e1c80e8ab32e0a100f57d7cf5f5e151))
- roll to Chrome 131.0.6778.85 ([#13312](https://github.com/puppeteer/puppeteer/issues/13312)) ([374cead](https://github.com/puppeteer/puppeteer/commit/374cead4b5537cf041dc5a1e38206e1a86333842))

## [23.8.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.7.1...puppeteer-v23.8.0) (2024-11-13)

### Features

- roll to Chrome 131.0.6778.69 ([#13291](https://github.com/puppeteer/puppeteer/issues/13291)) ([34568e0](https://github.com/puppeteer/puppeteer/commit/34568e0b2d9e8a95050bd60e54d1d21b1cd0558c))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.7.1 to 23.8.0

### Bug Fixes

- add getDefaultNavigationTimeout to Page ([#13277](https://github.com/puppeteer/puppeteer/issues/13277)) ([8b64c2c](https://github.com/puppeteer/puppeteer/commit/8b64c2cd01f7df44c1b667c4f1f2b676e0fab0a8))
- roll to Firefox 132.0.2 ([#13293](https://github.com/puppeteer/puppeteer/issues/13293)) ([aae6b33](https://github.com/puppeteer/puppeteer/commit/aae6b33cd0053ce75ad66e91d804f288fa8c9794))
- **webdriver:** frameElement() should return handles in the main world ([#13287](https://github.com/puppeteer/puppeteer/issues/13287)) ([2fde1ce](https://github.com/puppeteer/puppeteer/commit/2fde1ce4e09c4b084033537baea77fdd58b0c213))

## [23.7.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.7.0...puppeteer-v23.7.1) (2024-11-07)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.7.0 to 23.7.1

### Bug Fixes

- roll to Chrome 130.0.6723.116 ([#13274](https://github.com/puppeteer/puppeteer/issues/13274)) ([979af2b](https://github.com/puppeteer/puppeteer/commit/979af2bccdd684bb26f61518cc42e248ad2c8cfb))
- roll to Chrome 130.0.6723.93 ([#13268](https://github.com/puppeteer/puppeteer/issues/13268)) ([b7c7785](https://github.com/puppeteer/puppeteer/commit/b7c77852911164a1c167cb7cb0906cb27a70e122))
- roll to Firefox 132.0.1 ([#13265](https://github.com/puppeteer/puppeteer/issues/13265)) ([acd3c72](https://github.com/puppeteer/puppeteer/commit/acd3c7249e06446709830daabd48ce4421496278))
- **webdriver:** report frame URL as console message location ([#13273](https://github.com/puppeteer/puppeteer/issues/13273)) ([33b4f09](https://github.com/puppeteer/puppeteer/commit/33b4f09021faea6a3c639ff7fa7f96099a02ffd4))

## [23.7.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.6.1...puppeteer-v23.7.0) (2024-11-04)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.4.0 to 2.4.1

### Features

- distinguish different Touches ([#13231](https://github.com/puppeteer/puppeteer/issues/13231)) ([a2a205c](https://github.com/puppeteer/puppeteer/commit/a2a205c2e8ffbc5b9c73bee0466ac0bf00fb4657))
- roll to Firefox 132.0 ([#13252](https://github.com/puppeteer/puppeteer/issues/13252)) ([41d3dd9](https://github.com/puppeteer/puppeteer/commit/41d3dd9f0ceec5f551fc111f653645286169209f))

### Bug Fixes

- **browser:** omit file path validation in uploadFile() in browser environments ([#13258](https://github.com/puppeteer/puppeteer/issues/13258)) ([a9e6cd1](https://github.com/puppeteer/puppeteer/commit/a9e6cd1ed231c161ba83712b690fa6aab47a87a5))
- remove event listeners from AbortSignal in WaitTask ([#13257](https://github.com/puppeteer/puppeteer/issues/13257)) ([4e5c0ad](https://github.com/puppeteer/puppeteer/commit/4e5c0ad1c770d6bd1785325cdf5c0a63f285e5c2))
- roll to Chrome 130.0.6723.91 ([#13255](https://github.com/puppeteer/puppeteer/issues/13255)) ([8295e67](https://github.com/puppeteer/puppeteer/commit/8295e67874a31de43570c04b8608073808e5db0d))

## [23.6.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.6.0...puppeteer-v23.6.1) (2024-10-28)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.6.0 to 23.6.1

### Bug Fixes

- correctly handle errors in the ExtensionTransport ([#13244](https://github.com/puppeteer/puppeteer/issues/13244)) ([1fee9ff](https://github.com/puppeteer/puppeteer/commit/1fee9ff269d59e9750b264fe46c9b8be7d36bff1))
- roll to Chrome 130.0.6723.69 ([#13227](https://github.com/puppeteer/puppeteer/issues/13227)) ([76390bf](https://github.com/puppeteer/puppeteer/commit/76390bf5ac1cb6d70962f3a99cbfd43675ed8e4f))
- **webdriver:** consider subdomain in cookie filtering ([#13232](https://github.com/puppeteer/puppeteer/issues/13232)) ([98102ec](https://github.com/puppeteer/puppeteer/commit/98102ececf253ef6f0305d4dfb96e23981ea02f2))
- **webdriver:** partially handle client-side redirects in page.goto ([#13222](https://github.com/puppeteer/puppeteer/issues/13222)) ([442ed05](https://github.com/puppeteer/puppeteer/commit/442ed05b67c806339edf5fffee37fe27e7f410a3))

## [23.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.5.3...puppeteer-v23.6.0) (2024-10-16)

### Features

- remove --disable-component-update from default args ([#13201](https://github.com/puppeteer/puppeteer/issues/13201)) ([19dd9c3](https://github.com/puppeteer/puppeteer/commit/19dd9c385a34c01cf6aad4c207165962d888e63f))
- roll to Chrome 130.0.6723.58 ([#13195](https://github.com/puppeteer/puppeteer/issues/13195)) ([1cf5116](https://github.com/puppeteer/puppeteer/commit/1cf5116a2d3dd817cf38e46363e483fee58ed5bc))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.5.3 to 23.6.0

### Bug Fixes

- re-export node reference removed by TS 5.5 ([#13200](https://github.com/puppeteer/puppeteer/issues/13200)) ([1300e59](https://github.com/puppeteer/puppeteer/commit/1300e595cdea37e09f28d68bb06ead47b0883059))
- roll to Firefox 131.0.3 ([#13189](https://github.com/puppeteer/puppeteer/issues/13189)) ([d7bc66e](https://github.com/puppeteer/puppeteer/commit/d7bc66ef9c58e124b61ab20cc4508ca659a4541a))

## [23.5.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.5.2...puppeteer-v23.5.3) (2024-10-10)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.5.2 to 23.5.3

### Bug Fixes

- roll to Chrome 129.0.6668.100 ([#13174](https://github.com/puppeteer/puppeteer/issues/13174)) ([de145c3](https://github.com/puppeteer/puppeteer/commit/de145c3b26e82821b79689da62da73041a4ea7f5))
- roll to Firefox 131.0.2 ([#13171](https://github.com/puppeteer/puppeteer/issues/13171)) ([5b2b1fe](https://github.com/puppeteer/puppeteer/commit/5b2b1fe67dbd215df9acad948b63d39642621171))

## [23.5.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.5.1...puppeteer-v23.5.2) (2024-10-09)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.5.1 to 23.5.2

### Bug Fixes

- roll to Chrome 129.0.6668.91 ([#13166](https://github.com/puppeteer/puppeteer/issues/13166)) ([8a216f1](https://github.com/puppeteer/puppeteer/commit/8a216f19380d792d9f84144fa8d63a6ed81a20c3))

## [23.5.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.5.0...puppeteer-v23.5.1) (2024-10-07)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.5.0 to 23.5.1

### Bug Fixes

- default to RAF polling if visible||hidden is set ([#13153](https://github.com/puppeteer/puppeteer/issues/13153)) ([dd13d5d](https://github.com/puppeteer/puppeteer/commit/dd13d5d65a6d5d1f745ce7cfaa170d0a5f725cfe)), closes [#13152](https://github.com/puppeteer/puppeteer/issues/13152)
- handle shadow DOM in Frame.frameElement ([#13156](https://github.com/puppeteer/puppeteer/issues/13156)) ([57a8df0](https://github.com/puppeteer/puppeteer/commit/57a8df069b10217174ba494a1cd2b594d966778d)), closes [#13155](https://github.com/puppeteer/puppeteer/issues/13155)

## [23.5.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.4.1...puppeteer-v23.5.0) (2024-10-02)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.4.1 to 23.5.0

### Features

- roll to Firefox 131.0 ([#13148](https://github.com/puppeteer/puppeteer/issues/13148)) ([b5b8601](https://github.com/puppeteer/puppeteer/commit/b5b8601a7660b50c16e04f8683f38e6e35f5e2e8))

### Bug Fixes

- handle requestservedfromcache during interception ([#13134](https://github.com/puppeteer/puppeteer/issues/13134)) ([3ad2e45](https://github.com/puppeteer/puppeteer/commit/3ad2e45c295083de6fc72a5041138c620615b755))
- roll to Chrome 129.0.6668.89 ([#13150](https://github.com/puppeteer/puppeteer/issues/13150)) ([cab123e](https://github.com/puppeteer/puppeteer/commit/cab123e68ee2e50a66da434346ec39afe000b2f7))
- **webdriver:** dispose child browsing contexts ([#13137](https://github.com/puppeteer/puppeteer/issues/13137)) ([378762d](https://github.com/puppeteer/puppeteer/commit/378762d6e170040901f5c3ccb66968db37f44051))

## [23.4.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.4.0...puppeteer-v23.4.1) (2024-09-25)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.4.0 to 23.4.1

### Bug Fixes

- roll to Chrome 129.0.6668.70 ([#13125](https://github.com/puppeteer/puppeteer/issues/13125)) ([dfd2e64](https://github.com/puppeteer/puppeteer/commit/dfd2e64802d6b2948cb99e5608f707b0013f847b))
- show browser in error ([#13119](https://github.com/puppeteer/puppeteer/issues/13119)) ([98cad4e](https://github.com/puppeteer/puppeteer/commit/98cad4eb1f88585ea0c222d9c19a3eb3de3c78fd))
- **webdriver:** convert console method to type ([#13120](https://github.com/puppeteer/puppeteer/issues/13120)) ([429319e](https://github.com/puppeteer/puppeteer/commit/429319e6fe562a9163463a374574533575beab9a))

## [23.4.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.3.1...puppeteer-v23.4.0) (2024-09-18)

### Features

- roll to Chrome 129.0.6668.58 ([#13099](https://github.com/puppeteer/puppeteer/issues/13099)) ([6614660](https://github.com/puppeteer/puppeteer/commit/661466031edf730022bce4d706f76dd0b04dea05))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.3.1 to 23.4.0

### Bug Fixes

- **extensions:** handle attachToTarget command correctly ([#13095](https://github.com/puppeteer/puppeteer/issues/13095)) ([61fa00e](https://github.com/puppeteer/puppeteer/commit/61fa00eae5a296c9a616d163423b5093f004dd32)), closes [#13089](https://github.com/puppeteer/puppeteer/issues/13089)
- roll to Firefox 130.0.1 ([#13100](https://github.com/puppeteer/puppeteer/issues/13100)) ([a1df1dc](https://github.com/puppeteer/puppeteer/commit/a1df1dce9956e666f150240369475dd04d20b8c8))

## [23.3.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.3.0...puppeteer-v23.3.1) (2024-09-16)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.3.0 to 23.3.1

### Bug Fixes

- improve Precision of Paper Sizes in Inches to 4 Decimal Places ([#13087](https://github.com/puppeteer/puppeteer/issues/13087)) ([47d6c44](https://github.com/puppeteer/puppeteer/commit/47d6c4423e61b42867840e6714567b529040593a))
- roll to Chrome 128.0.6613.137 ([#13071](https://github.com/puppeteer/puppeteer/issues/13071)) ([27df147](https://github.com/puppeteer/puppeteer/commit/27df147a28684cd0a9ad2229e63e740eceb63615))

## [23.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.2.2...puppeteer-v23.3.0) (2024-09-04)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.3.1 to 2.4.0

### Features

- roll to Firefox 130.0 ([#13046](https://github.com/puppeteer/puppeteer/issues/13046)) ([f311a65](https://github.com/puppeteer/puppeteer/commit/f311a65f6b5d15ece791844959d6cd18165c2474))

### Bug Fixes

- incorrect y-coordinate in ElementHandle.boxModel() ([#13045](https://github.com/puppeteer/puppeteer/issues/13045)) ([afe77af](https://github.com/puppeteer/puppeteer/commit/afe77af53ba672dda487c6ceccf66ea7c7908105))
- revert the use of structuredClone ([#13044](https://github.com/puppeteer/puppeteer/issues/13044)) ([96b3a8b](https://github.com/puppeteer/puppeteer/commit/96b3a8b33f648fdae43179ab237182683836b8ec))

## [23.2.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.2.1...puppeteer-v23.2.2) (2024-09-03)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.2.1 to 23.2.2

### Bug Fixes

- improve frame session management ([#13022](https://github.com/puppeteer/puppeteer/issues/13022)) ([049e13c](https://github.com/puppeteer/puppeteer/commit/049e13c5f84d82c21d73cacc4ecdf29afcbdc32f))
- incorrect error message when encountering launch browser error. ([#13021](https://github.com/puppeteer/puppeteer/issues/13021)) ([9aef4ab](https://github.com/puppeteer/puppeteer/commit/9aef4ab63878dfa64a6675b201d80e3dfaf9b065))
- roll to Chrome 128.0.6613.119 ([#13035](https://github.com/puppeteer/puppeteer/issues/13035)) ([cd4f340](https://github.com/puppeteer/puppeteer/commit/cd4f340230652903d6f1432c5ed79ddaee89fefd))

## [23.2.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.2.0...puppeteer-v23.2.1) (2024-08-29)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.2.0 to 23.2.1

### Bug Fixes

- roll to Chrome 128.0.6613.86 ([#13013](https://github.com/puppeteer/puppeteer/issues/13013)) ([d41cc51](https://github.com/puppeteer/puppeteer/commit/d41cc5136ce5d431a0a522cbc4238b6c08383e2f))

## [23.2.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.1.1...puppeteer-v23.2.0) (2024-08-26)

### Features

- roll to Chrome 128.0.6613.84 ([#13005](https://github.com/puppeteer/puppeteer/issues/13005)) ([132a7ce](https://github.com/puppeteer/puppeteer/commit/132a7ce624ed8a9529c19c057c486bea2e737cb7))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.1.1 to 23.2.0

## [23.1.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.1.0...puppeteer-v23.1.1) (2024-08-21)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.1.0 to 23.1.1

### Bug Fixes

- roll to Firefox 129.0.1 ([#12975](https://github.com/puppeteer/puppeteer/issues/12975)) ([778ae6f](https://github.com/puppeteer/puppeteer/commit/778ae6f2821e4ae5a5b3f65736a4b6bad2b0a56e))
- roll to Firefox 129.0.2 ([#12987](https://github.com/puppeteer/puppeteer/issues/12987)) ([d934cf5](https://github.com/puppeteer/puppeteer/commit/d934cf52cd9194a90f1ca2f2c76fd6471bbd0033))

## [23.1.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.0.2...puppeteer-v23.1.0) (2024-08-14)

### Features

- improve type inference for selectors by adopting "typed-query-selector" ([#12950](https://github.com/puppeteer/puppeteer/issues/12950)) ([77b729e](https://github.com/puppeteer/puppeteer/commit/77b729e23e7d1c595460e991d2ecf3c1f9786373))
- support signal in WaitFor functions ([#12926](https://github.com/puppeteer/puppeteer/issues/12926)) ([67e3be8](https://github.com/puppeteer/puppeteer/commit/67e3be80ca9ea050cfb023024af3b6f5b58a9bed))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.3.0 to 2.3.1

### Bug Fixes

- add missing partitionKey for page.deleteCookie() ([#12815](https://github.com/puppeteer/puppeteer/issues/12815)) ([41df7cb](https://github.com/puppeteer/puppeteer/commit/41df7cb2885c0bcafa1c95ac33451913897a4391))
- **firefox:** back up user.js as well ([#12943](https://github.com/puppeteer/puppeteer/issues/12943)) ([9feda9c](https://github.com/puppeteer/puppeteer/commit/9feda9cdfce81cb375193d0efa9efa0c13b2818d))
- roll to Chrome 127.0.6533.119 ([#12951](https://github.com/puppeteer/puppeteer/issues/12951)) ([cc2eda2](https://github.com/puppeteer/puppeteer/commit/cc2eda26620c9c20691b1bd151ccd2d87f979344))
- **webdriver:** throw an error on pipe provided for Firefox ([#12934](https://github.com/puppeteer/puppeteer/issues/12934)) ([bec089c](https://github.com/puppeteer/puppeteer/commit/bec089c20c4d5f07e77e979caea5906afb45c8b2))

## [23.0.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.0.1...puppeteer-v23.0.2) (2024-08-08)

### Bug Fixes

- roll to Chrome 127.0.6533.99 ([#12910](https://github.com/puppeteer/puppeteer/issues/12910)) ([ffc90b2](https://github.com/puppeteer/puppeteer/commit/ffc90b2fc19e5347e59e7e2e361733c602759567))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.0.1 to 23.0.2

## [23.0.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v23.0.0...puppeteer-v23.0.1) (2024-08-07)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 23.0.0 to 23.0.1

### Bug Fixes

- **webdriver:** fix default protocol for Firefox ([#12902](https://github.com/puppeteer/puppeteer/issues/12902)) ([054916b](https://github.com/puppeteer/puppeteer/commit/054916b50cd943759d2ff1b33b397d6cd5e8687e))

## [23.0.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.15.0...puppeteer-v23.0.0) (2024-08-07)

### ⚠ BREAKING CHANGES

- remove deprecated Frame.isOOPFrame() ([#12897](https://github.com/puppeteer/puppeteer/issues/12897))
- use Uint8Array instead of Buffer for browser compatibility ([#12823](https://github.com/puppeteer/puppeteer/issues/12823))
- remove isIncognito ([#12830](https://github.com/puppeteer/puppeteer/issues/12830))
- support multiple browser downloads for Puppeteer ([#12795](https://github.com/puppeteer/puppeteer/issues/12795))
- remove deprecated functions for CustomQueryHandler ([#12824](https://github.com/puppeteer/puppeteer/issues/12824))
- rename ignoreHttpsErrors to acceptInsecureCerts ([#12756](https://github.com/puppeteer/puppeteer/issues/12756))
- rename product to browser ([#12757](https://github.com/puppeteer/puppeteer/issues/12757))
- default to WebDriver BiDi for Firefox ([#12732](https://github.com/puppeteer/puppeteer/issues/12732))
- replace dynamic imports with static dependency injection ([#12710](https://github.com/puppeteer/puppeteer/issues/12710))
- remove whitespace normalization from a11y selectors ([#12693](https://github.com/puppeteer/puppeteer/issues/12693))

### Features

- default to WebDriver BiDi for Firefox ([#12732](https://github.com/puppeteer/puppeteer/issues/12732)) ([6422dc2](https://github.com/puppeteer/puppeteer/commit/6422dc230aa4205e9ca1aada47cf46f0a44f0bb3))
- pin Firefox to stable_129.0 ([#12890](https://github.com/puppeteer/puppeteer/issues/12890)) ([311b57b](https://github.com/puppeteer/puppeteer/commit/311b57b96d213a804e084ff8f62f10ecc950bb11))
- rename ignoreHttpsErrors to acceptInsecureCerts ([#12756](https://github.com/puppeteer/puppeteer/issues/12756)) ([04e2263](https://github.com/puppeteer/puppeteer/commit/04e2263d4bfeb6ad396a4312c79b502a73b35e31))
- rename product to browser ([#12757](https://github.com/puppeteer/puppeteer/issues/12757)) ([ca82e8e](https://github.com/puppeteer/puppeteer/commit/ca82e8e070dd1ddb627d034888782133d8cad49c))
- support multiple browser downloads for Puppeteer ([#12795](https://github.com/puppeteer/puppeteer/issues/12795)) ([4d4b358](https://github.com/puppeteer/puppeteer/commit/4d4b358dca34ab23df075efd08a62947e6feb98c))
- **webdriver:** support WebDriver capabilities in puppeteer.connect ([#12877](https://github.com/puppeteer/puppeteer/issues/12877)) ([897df47](https://github.com/puppeteer/puppeteer/commit/897df478b4b64ac9b146378d32b1f1b8347c6263))

### Code Refactoring

- remove deprecated Frame.isOOPFrame() ([#12897](https://github.com/puppeteer/puppeteer/issues/12897)) ([88cd5e4](https://github.com/puppeteer/puppeteer/commit/88cd5e4d37d2056dad7c5d80c627d5760c05d77d))
- remove deprecated functions for CustomQueryHandler ([#12824](https://github.com/puppeteer/puppeteer/issues/12824)) ([5e2043d](https://github.com/puppeteer/puppeteer/commit/5e2043df7ff6230c1cd6f2b126087232d91c66d5))
- remove isIncognito ([#12830](https://github.com/puppeteer/puppeteer/issues/12830)) ([9e82e2b](https://github.com/puppeteer/puppeteer/commit/9e82e2b640378314e1ea5102727bdd4274baf57b))
- replace dynamic imports with static dependency injection ([#12710](https://github.com/puppeteer/puppeteer/issues/12710)) ([3aacc1c](https://github.com/puppeteer/puppeteer/commit/3aacc1c80792dee34ebbaa3cbf9d32d2baf2b139))
- use Uint8Array instead of Buffer for browser compatibility ([#12823](https://github.com/puppeteer/puppeteer/issues/12823)) ([f3377e1](https://github.com/puppeteer/puppeteer/commit/f3377e1708a72f7f4395678492755f577dd57936))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.15.0 to 23.0.0

### Bug Fixes

- only wait for page and frame targets when connecting ([#12888](https://github.com/puppeteer/puppeteer/issues/12888)) ([22f67d4](https://github.com/puppeteer/puppeteer/commit/22f67d4fb446f2d4553b4d4101038c79cbffbf0e))
- remove whitespace normalization from a11y selectors ([#12693](https://github.com/puppeteer/puppeteer/issues/12693)) ([d5f9a33](https://github.com/puppeteer/puppeteer/commit/d5f9a333c1d2052f41bdcd0ad773f5dbb202ef09))

## [22.15.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.14.0...puppeteer-v22.15.0) (2024-07-31)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.14.0 to 22.15.0

### Features

- support AbortSignal in waitForNavigation ([#12852](https://github.com/puppeteer/puppeteer/issues/12852)) ([9a35f7b](https://github.com/puppeteer/puppeteer/commit/9a35f7ba189e3a0250a4bd2e3b40efee9c6e2b18))

### Bug Fixes

- handle the string predicate in waitForFrame ([#12849](https://github.com/puppeteer/puppeteer/issues/12849)) ([9ec5f25](https://github.com/puppeteer/puppeteer/commit/9ec5f25ea6f9e60d250c7413e122a5c32faeb3f9))
- roll to Chrome 127.0.6533.88 ([#12858](https://github.com/puppeteer/puppeteer/issues/12858)) ([4b0e889](https://github.com/puppeteer/puppeteer/commit/4b0e8890ef9fd4e581da49072f1a04118087a2a2))
- **webdriver:** implement request timings ([#12831](https://github.com/puppeteer/puppeteer/issues/12831)) ([409d244](https://github.com/puppeteer/puppeteer/commit/409d244aed480fbb5254f852afb16bd101692f9a))

## [22.14.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.13.1...puppeteer-v22.14.0) (2024-07-25)

### Features

- roll to Chrome 127.0.6533.72 ([#12821](https://github.com/puppeteer/puppeteer/issues/12821)) ([8e6fd74](https://github.com/puppeteer/puppeteer/commit/8e6fd74de15c773ffd046b313b681a4afd162d38))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.2.4 to 2.3.0

### Bug Fixes

- **webdriver:** allow accessing raw CDP connection when using WebDriver BiDi ([#12771](https://github.com/puppeteer/puppeteer/issues/12771)) ([059cacc](https://github.com/puppeteer/puppeteer/commit/059caccad7dab47f2351f1307210aef77c356bb3))
- **webdriver:** dispose resources to abort active listeners ([#12817](https://github.com/puppeteer/puppeteer/issues/12817)) ([c452c5f](https://github.com/puppeteer/puppeteer/commit/c452c5f7e5b9bb202d3dac35eeac031fb8ff55bb))
- **webdriver:** in page.goto consider only the first emitted navigation event ([#12777](https://github.com/puppeteer/puppeteer/issues/12777)) ([cd740b2](https://github.com/puppeteer/puppeteer/commit/cd740b2eeffc6cf6b38a94522e87b1a597647513))

## [22.13.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.13.0...puppeteer-v22.13.1) (2024-07-17)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.2.3 to 2.2.4

### Bug Fixes

- include Puppeteer version into utility world name ([#12754](https://github.com/puppeteer/puppeteer/issues/12754)) ([2e86012](https://github.com/puppeteer/puppeteer/commit/2e860124b94787ec6602212efe78aca2034f2136))
- roll to Chrome 126.0.6478.182 (r1300313) ([#12764](https://github.com/puppeteer/puppeteer/issues/12764)) ([a98ac2e](https://github.com/puppeteer/puppeteer/commit/a98ac2e6ea052a88e180612375cf087f732603b8))
- **webdriver:** add postData,hasPostData,resourceType from cdp-over-bidi ([#12739](https://github.com/puppeteer/puppeteer/issues/12739)) ([dc5379e](https://github.com/puppeteer/puppeteer/commit/dc5379e744979c9a58905ed3d939c2722a188c8d))
- **webdriver:** support securityDetails with cdp-over-bidi ([#12736](https://github.com/puppeteer/puppeteer/issues/12736)) ([4308104](https://github.com/puppeteer/puppeteer/commit/43081045a3af3f4aaeb7595591ac6f774baf21ca))

## [22.13.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.12.1...puppeteer-v22.13.0) (2024-07-11)

### Bug Fixes

- add an option to not wait for fonts when pdf printing ([#12675](https://github.com/puppeteer/puppeteer/issues/12675)) ([a573dbd](https://github.com/puppeteer/puppeteer/commit/a573dbd7ed858651b92dc5deafe2ebdbe86b5f4c))
- add browser entrypoint to package.json of puppeteer-core ([#12729](https://github.com/puppeteer/puppeteer/issues/12729)) ([669c86b](https://github.com/puppeteer/puppeteer/commit/669c86b203e7ad18e7be3d6fc847872c48d05617))
- **cli:** puppeteer CLI should read the project configuration ([#12730](https://github.com/puppeteer/puppeteer/issues/12730)) ([bca750a](https://github.com/puppeteer/puppeteer/commit/bca750afe204cc3bafb0a34a0f92b0bac5a6a55f))
- correct validation of the quality parameter in page.screenshot ([#12725](https://github.com/puppeteer/puppeteer/issues/12725)) ([2f8abd7](https://github.com/puppeteer/puppeteer/commit/2f8abd7a6c9be7f3ee5123e55da76c51ea132c58))
- do not allow switching tabs while the screenshot operation is in progress ([#12724](https://github.com/puppeteer/puppeteer/issues/12724)) ([a3345f6](https://github.com/puppeteer/puppeteer/commit/a3345f6686c7634904fbd72df12588f3e230878f))
- don't rely on Buffer to be present ([#12702](https://github.com/puppeteer/puppeteer/issues/12702)) ([3c02cef](https://github.com/puppeteer/puppeteer/commit/3c02ceffa366f747c84fa38af058c8b2dab7e3c5))
- ensure existing targets are attached to pages ([#12677](https://github.com/puppeteer/puppeteer/issues/12677)) ([d1d8489](https://github.com/puppeteer/puppeteer/commit/d1d8489a9616375f5195ea226b7123345402030b))
- make sure bindings are working after a page is restored from bfcache ([#12663](https://github.com/puppeteer/puppeteer/issues/12663)) ([570b1a8](https://github.com/puppeteer/puppeteer/commit/570b1a862eed1ce86dba318e143d7d4191a89c3b))
- support evaluateOnNewDocument for out-of-process frames ([#12714](https://github.com/puppeteer/puppeteer/issues/12714)) ([eac7cda](https://github.com/puppeteer/puppeteer/commit/eac7cda537255eedb61e4ac689c1c919f892d491))
- support out-of-process iframes in exposeFunction ([#12722](https://github.com/puppeteer/puppeteer/issues/12722)) ([b6b536b](https://github.com/puppeteer/puppeteer/commit/b6b536bb2f38b052b12a8902be348132c78a04f6))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.12.1 to 22.13.0

### Features

- **webdriver:** implement page.setCacheEnabled ([#12691](https://github.com/puppeteer/puppeteer/issues/12691)) ([e44d900](https://github.com/puppeteer/puppeteer/commit/e44d900c0cb7c725f88a477375f7b9658ef92eb8))

## [22.12.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.12.0...puppeteer-v22.12.1) (2024-06-26)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.12.0 to 22.12.1

### Bug Fixes

- execution contexts might be created before previous is destroyed ([#12666](https://github.com/puppeteer/puppeteer/issues/12666)) ([db642d1](https://github.com/puppeteer/puppeteer/commit/db642d1d6975a9b12700a471f6cacc8daf6bd04d))
- reset the viewport after taking a fullPage screenshot if defaultViewport is null ([#12650](https://github.com/puppeteer/puppeteer/issues/12650)) ([0a32283](https://github.com/puppeteer/puppeteer/commit/0a32283cfccba306fa20dc5b5c31487a6d8fb201))
- roll to Chrome 126.0.6478.126 (r1300313) ([#12656](https://github.com/puppeteer/puppeteer/issues/12656)) ([32ed82c](https://github.com/puppeteer/puppeteer/commit/32ed82c623905755944b1cf2d9e0cd9d952c8f94))
- use RAF-based polling for ARIA selectors ([#12664](https://github.com/puppeteer/puppeteer/issues/12664)) ([56d1d3f](https://github.com/puppeteer/puppeteer/commit/56d1d3f8b731d18c6aa9cc3d6de9c722b93a7a1e))

## [22.12.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.11.2...puppeteer-v22.12.0) (2024-06-21)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.11.2 to 22.12.0

### Features

- support AbortSignal in page.waitForRequest/Response/NetworkIdle/Frame ([#12621](https://github.com/puppeteer/puppeteer/issues/12621)) ([54ecea7](https://github.com/puppeteer/puppeteer/commit/54ecea7db5180ec024d81a7ac14c73387550d1d6))
- **webdriver:** support for `PageEvent.Popup` ([#12612](https://github.com/puppeteer/puppeteer/issues/12612)) ([293926b](https://github.com/puppeteer/puppeteer/commit/293926b61a3552f9ec7e9a62383688e775f12df0))

### Bug Fixes

- **performance:** clear targets on browser context close ([#12609](https://github.com/puppeteer/puppeteer/issues/12609)) ([6609758](https://github.com/puppeteer/puppeteer/commit/660975824ac94b85a260e99b95db0a11bb5a2e07))
- roll to Chrome 126.0.6478.62 (r1300313) ([#12615](https://github.com/puppeteer/puppeteer/issues/12615)) ([80dd131](https://github.com/puppeteer/puppeteer/commit/80dd1316a09e87dda65f68e5cbe299d335147599))
- roll to Chrome 126.0.6478.63 (r1300313) ([#12632](https://github.com/puppeteer/puppeteer/issues/12632)) ([20ed8fc](https://github.com/puppeteer/puppeteer/commit/20ed8fcb1415501525368305a9bc509af03d63ff))

## [22.11.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.11.1...puppeteer-v22.11.2) (2024-06-18)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.11.1 to 22.11.2

### Bug Fixes

- **deps:** bump ws to 8.17.1 ([#12605](https://github.com/puppeteer/puppeteer/issues/12605)) ([49bcb25](https://github.com/puppeteer/puppeteer/commit/49bcb2537e45c903e6c1d5d360b0077f0153c5d2))

## [22.11.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.11.0...puppeteer-v22.11.1) (2024-06-17)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.11.0 to 22.11.1

### Bug Fixes

- connection closed error should be a rejected promise ([#12575](https://github.com/puppeteer/puppeteer/issues/12575)) ([e36ce8b](https://github.com/puppeteer/puppeteer/commit/e36ce8bee18b4a8c7bf4c0692269d0095d186d06))
- ensure selector parser falls back to CSS ([#12585](https://github.com/puppeteer/puppeteer/issues/12585)) ([80783fe](https://github.com/puppeteer/puppeteer/commit/80783fef5a298d2c57f64415f1882d0b051625ef))
- implement nested selector parsing ([#12587](https://github.com/puppeteer/puppeteer/issues/12587)) ([3874300](https://github.com/puppeteer/puppeteer/commit/38743007159beedcad8571c08c3320235eb93f76))
- roll to Chrome 126.0.6478.61 (r1300313) ([#12586](https://github.com/puppeteer/puppeteer/issues/12586)) ([772e088](https://github.com/puppeteer/puppeteer/commit/772e088f9cc566832b36066c3a6627b5afd47769))

## [22.11.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.10.1...puppeteer-v22.11.0) (2024-06-12)

### Features

- allow creating ElementHandles from the accessibility tree snapshot ([#12233](https://github.com/puppeteer/puppeteer/issues/12233)) ([0057f3f](https://github.com/puppeteer/puppeteer/commit/0057f3fe0a8d179cacb18495c96987310f83d5d9))
- roll to Chrome 126.0.6478.55 (r1300313) ([#12572](https://github.com/puppeteer/puppeteer/issues/12572)) ([f5bc2b5](https://github.com/puppeteer/puppeteer/commit/f5bc2b53aea0d159dd2b7f4c7a0f7a8a224ae6e8))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.10.1 to 22.11.0

### Bug Fixes

- do not wait for extension page targets on connect ([#12574](https://github.com/puppeteer/puppeteer/issues/12574)) ([5f2ee98](https://github.com/puppeteer/puppeteer/commit/5f2ee98c5b93b0a52a98a1d8237189b8b0d15a10))

## [22.10.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.10.0...puppeteer-v22.10.1) (2024-06-11)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.10.0 to 22.10.1

### Bug Fixes

- add a way to run page.$$ without the isolation ([#12539](https://github.com/puppeteer/puppeteer/issues/12539)) ([03e10a7](https://github.com/puppeteer/puppeteer/commit/03e10a7559f184f8b1adfef83714f36ee26007ca))
- align network conditions presets with DevTools ([#12542](https://github.com/puppeteer/puppeteer/issues/12542)) ([ee10745](https://github.com/puppeteer/puppeteer/commit/ee1074559d5290eaa91e7757ecc048e81022fe48))
- exposed functions should only be called once ([#12560](https://github.com/puppeteer/puppeteer/issues/12560)) ([8aac8b1](https://github.com/puppeteer/puppeteer/commit/8aac8b1ccb1704f0a67165a7e06427c7db0b4b2f))
- **performance:** use Runtime.getProperties for improved performance ([#12561](https://github.com/puppeteer/puppeteer/issues/12561)) ([8b2059f](https://github.com/puppeteer/puppeteer/commit/8b2059f82a801daaa9d27f48d1925bd1335020c6))
- roll to Chrome 125.0.6422.141 (r1287751) ([#12509](https://github.com/puppeteer/puppeteer/issues/12509)) ([c4fdd10](https://github.com/puppeteer/puppeteer/commit/c4fdd102e9dd163e5797b2de9024e52ba6efe3bb))
- waitForSelector should work for pseudo classes ([#12545](https://github.com/puppeteer/puppeteer/issues/12545)) ([0b2999f](https://github.com/puppeteer/puppeteer/commit/0b2999f7b17d54f368f0a03a45c095e879b7245b))
- **webdriver:** default values for touch events ([#12554](https://github.com/puppeteer/puppeteer/issues/12554)) ([4d62988](https://github.com/puppeteer/puppeteer/commit/4d6298837fa85cce39394bfd63b04358b826db53))
- **webdriver:** frame url should not be updated on navigationStarted ([#12536](https://github.com/puppeteer/puppeteer/issues/12536)) ([7d0423b](https://github.com/puppeteer/puppeteer/commit/7d0423b12cb5987caf0cc0cd84976986ffc93c98))
- **webdriver:** HTTPRequest redirect chain from first request ([#12506](https://github.com/puppeteer/puppeteer/issues/12506)) ([68fd771](https://github.com/puppeteer/puppeteer/commit/68fd7712932f94730b6186107a0509c233938084))

## [22.10.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.9.0...puppeteer-v22.10.0) (2024-05-24)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.9.0 to 22.10.0

### Features

- support running Puppeteer in extensions ([#12459](https://github.com/puppeteer/puppeteer/issues/12459)) ([3c6f01a](https://github.com/puppeteer/puppeteer/commit/3c6f01a31dbaef0fdd7f477302b7daa95e0c0929))

### Bug Fixes

- providing null to page.authenticate should disable authentication ([#12203](https://github.com/puppeteer/puppeteer/issues/12203)) ([f375267](https://github.com/puppeteer/puppeteer/commit/f375267e790f61ee2a93d1f2811bef7539fc58d4))
- roll to Chrome 125.0.6422.76 (r1287751) ([#12477](https://github.com/puppeteer/puppeteer/issues/12477)) ([d83d9a6](https://github.com/puppeteer/puppeteer/commit/d83d9a6ae2b66b165a4aef5ae59ef3885bfbcff9))
- roll to Chrome 125.0.6422.78 (r1287751) ([#12484](https://github.com/puppeteer/puppeteer/issues/12484)) ([f30977f](https://github.com/puppeteer/puppeteer/commit/f30977f8172e3cca605514295fff2086bcd154be))
- **webdriver:** emit single HTTPRequest for Auth requests ([#12455](https://github.com/puppeteer/puppeteer/issues/12455)) ([637e827](https://github.com/puppeteer/puppeteer/commit/637e82796b492bcbc82d26753a019972b31a26fd))

## [22.9.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.8.2...puppeteer-v22.9.0) (2024-05-16)

### Features

- roll to Chrome 125.0.6422.60 (r1287751) ([#12446](https://github.com/puppeteer/puppeteer/issues/12446)) ([3de9fd3](https://github.com/puppeteer/puppeteer/commit/3de9fd3f4c88ec0bae190d385091c96badac3c1a))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.8.2 to 22.9.0

## [22.8.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.8.1...puppeteer-v22.8.2) (2024-05-14)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.8.1 to 22.8.2

### Bug Fixes

- roll to Chrome 124.0.6367.207 (r1274542) ([#12436](https://github.com/puppeteer/puppeteer/issues/12436)) ([0ef1920](https://github.com/puppeteer/puppeteer/commit/0ef192097a118ba83abb42fb5a9a54226c48a59b))
- **webdriver:** prefer globalThis over window to make it work in Firefox ([#12438](https://github.com/puppeteer/puppeteer/issues/12438)) ([33c6069](https://github.com/puppeteer/puppeteer/commit/33c606922725894f0823ad1c80f3d354c85992a2))

## [22.8.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.8.0...puppeteer-v22.8.1) (2024-05-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.8.0 to 22.8.1

### Bug Fixes

- roll to Chrome 124.0.6367.155 (r1274542) ([#12414](https://github.com/puppeteer/puppeteer/issues/12414)) ([d0cd710](https://github.com/puppeteer/puppeteer/commit/d0cd710e49884005f8322ea372b7696e3054d683))
- roll to Chrome 124.0.6367.201 (r1274542) ([#12420](https://github.com/puppeteer/puppeteer/issues/12420)) ([60f035c](https://github.com/puppeteer/puppeteer/commit/60f035cdc93ea87d40ea426097ea1f67754685e7))

## [22.8.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.7.1...puppeteer-v22.8.0) (2024-05-06)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.7.1 to 22.8.0

### Features

- **webdriver:** support `page.setUserAgent` for WebDriver BiDi ([#12330](https://github.com/puppeteer/puppeteer/issues/12330)) ([1f99e66](https://github.com/puppeteer/puppeteer/commit/1f99e669a1d644d1d17d5a7e926fbeafb8d231c6))
- **webdriver:** support ARIA selectors ([#12315](https://github.com/puppeteer/puppeteer/issues/12315)) ([88b46ee](https://github.com/puppeteer/puppeteer/commit/88b46ee5020d30355a3e52512030e1162502e4f5))

### Bug Fixes

- **cdp:** throw on closed connection ([#12352](https://github.com/puppeteer/puppeteer/issues/12352)) ([28a8d0f](https://github.com/puppeteer/puppeteer/commit/28a8d0ffb6345309df2bb23c9a5e2bd8be2f059d))
- deprecate CDP for Firefox ([#12349](https://github.com/puppeteer/puppeteer/issues/12349)) ([dffad28](https://github.com/puppeteer/puppeteer/commit/dffad28a429596be66741fb263e616437d7b965d))
- disable IsolateSandboxedIframes trial to prevent flakiness ([#12381](https://github.com/puppeteer/puppeteer/issues/12381)) ([461a8ff](https://github.com/puppeteer/puppeteer/commit/461a8ff92ff0e3887b4ceb4e4b7d1198eb8f7901))
- remove --disable-field-trial-config ([#12377](https://github.com/puppeteer/puppeteer/issues/12377)) ([54a6377](https://github.com/puppeteer/puppeteer/commit/54a6377d7d505e4580c78c06bb8a2c538bbf6857))
- roll to Chrome 124.0.6367.91 (r1274542) ([#12344](https://github.com/puppeteer/puppeteer/issues/12344)) ([fedd8a9](https://github.com/puppeteer/puppeteer/commit/fedd8a9628aed134e8fc725b4e6c3cb20d546581))
- turn on PdfOopif for PDF viewer ([#12370](https://github.com/puppeteer/puppeteer/issues/12370)) ([73d7692](https://github.com/puppeteer/puppeteer/commit/73d7692ae93959239f909cdee6ee849f8a70b7e5))
- **webdriver:** redirects emitting events ([#12338](https://github.com/puppeteer/puppeteer/issues/12338)) ([e1606ac](https://github.com/puppeteer/puppeteer/commit/e1606acfc800ab067ec5a8db336a70dba57b0827))

## [22.7.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.7.0...puppeteer-v22.7.1) (2024-04-25)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.2.2 to 2.2.3

### Bug Fixes

- roll to Chrome 124.0.6367.78 (r1274542) ([#12314](https://github.com/puppeteer/puppeteer/issues/12314)) ([1241ccc](https://github.com/puppeteer/puppeteer/commit/1241ccc90895e6a641a71ec3a6c2c97db96ef5c8))

## [22.7.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.5...puppeteer-v22.7.0) (2024-04-23)

### Features

- roll to Chrome 124.0.6367.60 (r1274542) ([#12305](https://github.com/puppeteer/puppeteer/issues/12305)) ([ed9d7dd](https://github.com/puppeteer/puppeteer/commit/ed9d7dd2f54595604639d0c9fdcaf9d5765daeeb))
- **webdriver:** support Network interception ([#12279](https://github.com/puppeteer/puppeteer/issues/12279)) ([8fa52a5](https://github.com/puppeteer/puppeteer/commit/8fa52a50bdb138444c0769557a8bdd6ac2784453))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.6.5 to 22.7.0

### Bug Fixes

- **performance:** cache isolatedHandle ([#12150](https://github.com/puppeteer/puppeteer/issues/12150)) ([9a17ec3](https://github.com/puppeteer/puppeteer/commit/9a17ec3b2a5e804bafc4d8c624740c148721e03e))

## [22.6.5](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.4...puppeteer-v22.6.5) (2024-04-15)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.2.1 to 2.2.2

### Bug Fixes

- remove NetworkServiceInProcess2 set by default ([#12261](https://github.com/puppeteer/puppeteer/issues/12261)) ([ff4f70f](https://github.com/puppeteer/puppeteer/commit/ff4f70f4ae7ca8deb0becbec2e49b35322dba336)), closes [#12257](https://github.com/puppeteer/puppeteer/issues/12257)
- use setImmediate to reduce flakiness when processing events ([#12264](https://github.com/puppeteer/puppeteer/issues/12264)) ([73403b3](https://github.com/puppeteer/puppeteer/commit/73403b323ec0dd8a08c164cb2c07751451215788))

## [22.6.4](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.3...puppeteer-v22.6.4) (2024-04-11)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.6.3 to 22.6.4

### Bug Fixes

- **a11y:** query only unignored nodes ([#12224](https://github.com/puppeteer/puppeteer/issues/12224)) ([e20cd64](https://github.com/puppeteer/puppeteer/commit/e20cd64fff374c4113777912c193f4a5d7d04297))
- retain stale main frame for longer ([#12225](https://github.com/puppeteer/puppeteer/issues/12225)) ([aa5b182](https://github.com/puppeteer/puppeteer/commit/aa5b1824a5c82005fcfc05b002facfbbb9810f8f))
- roll to Chrome 123.0.6312.122 (r1262506) ([#12248](https://github.com/puppeteer/puppeteer/issues/12248)) ([50b6659](https://github.com/puppeteer/puppeteer/commit/50b66591e70a7b6907d86594d7dacee6e76afc2d))
- **webdriver:** suppress error for error code errors ([5f7254c](https://github.com/puppeteer/puppeteer/commit/5f7254c41c7c1bda82477488f10254d204373d54))

## [22.6.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.2...puppeteer-v22.6.3) (2024-04-05)

### Bug Fixes

- check if executablePath exists ([#12201](https://github.com/puppeteer/puppeteer/issues/12201)) ([4ec0280](https://github.com/puppeteer/puppeteer/commit/4ec02800801d441238d6160a933f88f98c5f7165))
- roll to Chrome 123.0.6312.105 (r1262506) ([#12209](https://github.com/puppeteer/puppeteer/issues/12209)) ([ee31272](https://github.com/puppeteer/puppeteer/commit/ee312721152cce61a9e9cb2b78b71b40c4fa9e64))
- wait for fonts before pdf printing ([#12175](https://github.com/puppeteer/puppeteer/issues/12175)) ([59bffce](https://github.com/puppeteer/puppeteer/commit/59bffce9720b4d5e5204b26b335735e0a5ca9cc1))
- **webdriver:** request redirect chain ([#12168](https://github.com/puppeteer/puppeteer/issues/12168)) ([d345055](https://github.com/puppeteer/puppeteer/commit/d345055af3c63effbdfb2751274b9d7137b8a308))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.2.0 to 2.2.1

## [22.6.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.1...puppeteer-v22.6.2) (2024-03-28)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.6.1 to 22.6.2

### Bug Fixes

- roll to Chrome 123.0.6312.86 (r1262506) ([#12156](https://github.com/puppeteer/puppeteer/issues/12156)) ([29637f2](https://github.com/puppeteer/puppeteer/commit/29637f2b8f2dc1d684dbbb62d1a75857e016be33))

## [22.6.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.0...puppeteer-v22.6.1) (2024-03-25)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.6.0 to 22.6.1

### Bug Fixes

- apply timeout to waiting for a response ([#12142](https://github.com/puppeteer/puppeteer/issues/12142)) ([ac1767d](https://github.com/puppeteer/puppeteer/commit/ac1767da0b4214ced548a62dd737e2863f92c715))
- reload should not resolve early on fragment navigations ([#12119](https://github.com/puppeteer/puppeteer/issues/12119)) ([d476031](https://github.com/puppeteer/puppeteer/commit/d4760317c9bd359c9ecdb5f36231449dae16a8d2))
- support clip in ElementHandle.screenshot ([#12115](https://github.com/puppeteer/puppeteer/issues/12115)) ([b096ffa](https://github.com/puppeteer/puppeteer/commit/b096ffaa0359078bd5748b53b67e87c9453c7196))

## [22.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.5.0...puppeteer-v22.6.0) (2024-03-20)

### Features

- roll to Chrome 123.0.6312.58 (r1262506) ([#12110](https://github.com/puppeteer/puppeteer/issues/12110)) ([6f5b3bc](https://github.com/puppeteer/puppeteer/commit/6f5b3bc9b88c6d3204dda396f8963591ea6eb883))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.5.0 to 22.6.0

### Bug Fixes

- **webdriver:** emit RequestServedFromCache for requests ([#12104](https://github.com/puppeteer/puppeteer/issues/12104)) ([6ba6bef](https://github.com/puppeteer/puppeteer/commit/6ba6bef1b99742543942cef2f6c840bd543f5dee))

## [22.5.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.4.1...puppeteer-v22.5.0) (2024-03-15)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.1.0 to 2.2.0

### Features

- deprecate `Frame.prototype.name` ([#12084](https://github.com/puppeteer/puppeteer/issues/12084)) ([0203b45](https://github.com/puppeteer/puppeteer/commit/0203b4533dfec503f9ce7fcd07c3493021a9cecb))

### Bug Fixes

- fix keyboard.sendCharacter ([#12088](https://github.com/puppeteer/puppeteer/issues/12088)) ([2637622](https://github.com/puppeteer/puppeteer/commit/26376224d557ce30c911f670c5e7625dd1a1df72))
- roll to Chrome 122.0.6261.128 (r1250580) ([#12078](https://github.com/puppeteer/puppeteer/issues/12078)) ([ef7a9ea](https://github.com/puppeteer/puppeteer/commit/ef7a9eac16dcb466b220bcb0bc06a1eac3492354))
- **webdriver:** emit CDP events ([#12058](https://github.com/puppeteer/puppeteer/issues/12058)) ([9afe424](https://github.com/puppeteer/puppeteer/commit/9afe4246bb58c30a13215a254f9326935b24ece3))

## [22.4.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.4.0...puppeteer-v22.4.1) (2024-03-08)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.4.0 to 22.4.1

### Bug Fixes

- roll to Chrome 122.0.6261.111 (r1250580) ([#12055](https://github.com/puppeteer/puppeteer/issues/12055)) ([9b31bca](https://github.com/puppeteer/puppeteer/commit/9b31bca01adeb2ce04c97d9fcb3c6b6461469f07))

## [22.4.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.3.0...puppeteer-v22.4.0) (2024-03-05)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.3.0 to 22.4.0

### Features

- implement ElementHandle.uploadFile for WebDriver BiDi ([#11963](https://github.com/puppeteer/puppeteer/issues/11963)) ([accf2b6](https://github.com/puppeteer/puppeteer/commit/accf2b6ca84c93bc700277b4e3382d894fb45a76))
- **webdriver:** support `Page.deleteCookie()` for WebDriver BiDi ([#12031](https://github.com/puppeteer/puppeteer/issues/12031)) ([7fe22b5](https://github.com/puppeteer/puppeteer/commit/7fe22b533dc96104f28696eb4ff96b2543fd8e5b))

### Bug Fixes

- roll to Chrome 122.0.6261.94 (r1250580) ([#12012](https://github.com/puppeteer/puppeteer/issues/12012)) ([7ba5529](https://github.com/puppeteer/puppeteer/commit/7ba5529f8d6f8ed085968b7a9bc6f25f8d91abd5))
- **webdriver:** wait for response if the response has not completed once navigation has finished ([#12018](https://github.com/puppeteer/puppeteer/issues/12018)) ([6d8831a](https://github.com/puppeteer/puppeteer/commit/6d8831a9c398230f2543c3862d3fe5fc7cd2b940))

## [22.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.2.0...puppeteer-v22.3.0) (2024-02-25)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 22.2.0 to 22.3.0

### Features

- implement permissions for WebDriver BiDi ([#11979](https://github.com/puppeteer/puppeteer/issues/11979)) ([3a467c3](https://github.com/puppeteer/puppeteer/commit/3a467c39cb60de4237081ee201bd86051887c2f2))

### Bug Fixes

- roll to Chrome 122.0.6261.69 (r1250580) ([#11991](https://github.com/puppeteer/puppeteer/issues/11991)) ([eb2c334](https://github.com/puppeteer/puppeteer/commit/eb2c33485ec473e085c6b76b45554758764349d6))
- supress viewport errors for pages that do not support changing it ([#11970](https://github.com/puppeteer/puppeteer/issues/11970)) ([753a954](https://github.com/puppeteer/puppeteer/commit/753a954456699fc06adf67837225f306711af856))

## [22.2.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.1.0...puppeteer-v22.2.0) (2024-02-21)

### Features

- roll to Chrome 122.0.6261.57 (r1250580) ([#11958](https://github.com/puppeteer/puppeteer/issues/11958)) ([70ad3b2](https://github.com/puppeteer/puppeteer/commit/70ad3b244826ca102737e93cd2316e451ea310e8))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.0.1 to 2.1.0

### Bug Fixes

- deprecate isIncognito ([#11962](https://github.com/puppeteer/puppeteer/issues/11962)) ([ceab7a9](https://github.com/puppeteer/puppeteer/commit/ceab7a9042fe5fc3f71875e75327bb370f1c43a5))
- roll to Chrome 121.0.6167.184 (r1233107) ([#11948](https://github.com/puppeteer/puppeteer/issues/11948)) ([03ef7a6](https://github.com/puppeteer/puppeteer/commit/03ef7a62c23f2339e4d508d9abfe0894bd790cdd))
- update touchscreen tests ([#11960](https://github.com/puppeteer/puppeteer/issues/11960)) ([013bd0b](https://github.com/puppeteer/puppeteer/commit/013bd0b12d3a69f9d62fffe7911a327ad26d33d8))

## [22.1.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.0.0...puppeteer-v22.1.0) (2024-02-17)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 2.0.0 to 2.0.1

### Features

- support closing workers ([#11870](https://github.com/puppeteer/puppeteer/issues/11870)) ([1bdae40](https://github.com/puppeteer/puppeteer/commit/1bdae40ec865326fcb365320939869a6efb18c8a))

### Bug Fixes

- Chrome for Testing downloads have a new URL ([#11923](https://github.com/puppeteer/puppeteer/issues/11923)) ([f00a94a](https://github.com/puppeteer/puppeteer/commit/f00a94a809d38ee1c2c8cfc8597c66db9f3d243d))
- deprecate `Page.prototype.target` ([#11872](https://github.com/puppeteer/puppeteer/issues/11872)) ([15c986c](https://github.com/puppeteer/puppeteer/commit/15c986c2bc5f5005a738187674cd6c44bcb3df3d))
- frameElement should work for framesets ([#11842](https://github.com/puppeteer/puppeteer/issues/11842)) ([c5cee0e](https://github.com/puppeteer/puppeteer/commit/c5cee0e37dec8b90a17bf13400ede7ebdf453ac8))

## [22.0.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.11.0...puppeteer-v22.0.0) (2024-02-05)

### ⚠ BREAKING CHANGES

- rename createIncognitoBrowserContext to createBrowserContext ([#11834](https://github.com/puppeteer/puppeteer/issues/11834))
- enable the new-headless mode by default ([#11815](https://github.com/puppeteer/puppeteer/issues/11815))
- remove networkConditions in favor of PredefinedNetworkConditions ([#11806](https://github.com/puppeteer/puppeteer/issues/11806))
- use ReadableStreams ([#11805](https://github.com/puppeteer/puppeteer/issues/11805))
- remove duplicate type names ([#11803](https://github.com/puppeteer/puppeteer/issues/11803))
- remove add/removeEventListener in favor of on/off ([#11792](https://github.com/puppeteer/puppeteer/issues/11792))
- make console warn level compatible with WebDriver BiDi ([#11790](https://github.com/puppeteer/puppeteer/issues/11790))
- remove InterceptResolutionStrategy ([#11788](https://github.com/puppeteer/puppeteer/issues/11788))
- remove devices in favor of KnownDevices ([#11787](https://github.com/puppeteer/puppeteer/issues/11787))
- remove `$x` and `waitForXpath` ([#11782](https://github.com/puppeteer/puppeteer/issues/11782))
- remove waitForTimeout ([#11780](https://github.com/puppeteer/puppeteer/issues/11780))
- generate accessible PDFs by default ([#11778](https://github.com/puppeteer/puppeteer/issues/11778))
- remove `error` const, change CustomError to PuppeteerError ([#11777](https://github.com/puppeteer/puppeteer/issues/11777))
- remove viewport resizing from ElementHandle.screenshot ([#11774](https://github.com/puppeteer/puppeteer/issues/11774))
- remove PUPPETEER_DOWNLOAD_PATH in favor of PUPPETEER_CACHE_DIR ([#11605](https://github.com/puppeteer/puppeteer/issues/11605))
- BiDi cookies ([#11532](https://github.com/puppeteer/puppeteer/issues/11532))
- drop support for node16 ([#10912](https://github.com/puppeteer/puppeteer/issues/10912))

### Features

- BiDi cookies ([#11532](https://github.com/puppeteer/puppeteer/issues/11532)) ([9cb1fde](https://github.com/puppeteer/puppeteer/commit/9cb1fde58949811532644decb79b691318031d8c))
- drop support for node16 ([#10912](https://github.com/puppeteer/puppeteer/issues/10912)) ([953f420](https://github.com/puppeteer/puppeteer/commit/953f4207b17210fa7231225e6f29a826f77e0832))
- generate accessible PDFs by default ([#11778](https://github.com/puppeteer/puppeteer/issues/11778)) ([4fc1402](https://github.com/puppeteer/puppeteer/commit/4fc14026e9bfffeedf317e9b61c7cda8509091ba))
- remove PUPPETEER_DOWNLOAD_PATH in favor of PUPPETEER_CACHE_DIR ([#11605](https://github.com/puppeteer/puppeteer/issues/11605)) ([4677281](https://github.com/puppeteer/puppeteer/commit/467728187737283191f6528676e50d53dae6e5ef))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.9.1 to 2.0.0

### Bug Fixes

- make console warn level compatible with WebDriver BiDi ([#11790](https://github.com/puppeteer/puppeteer/issues/11790)) ([d4e9d8d](https://github.com/puppeteer/puppeteer/commit/d4e9d8d591e4fb1e2a33fe3a586a8beaccf263e8))
- remove viewport resizing from ElementHandle.screenshot ([#11774](https://github.com/puppeteer/puppeteer/issues/11774)) ([ced2235](https://github.com/puppeteer/puppeteer/commit/ced2235ada95ad67227df0ce579070ccb501a47b))

### Code Refactoring

- enable the new-headless mode by default ([#11815](https://github.com/puppeteer/puppeteer/issues/11815)) ([75c9e11](https://github.com/puppeteer/puppeteer/commit/75c9e117f1bf0d7a4de82c79201d70bf3cee2b6f))
- remove `$x` and `waitForXpath` ([#11782](https://github.com/puppeteer/puppeteer/issues/11782)) ([53c9134](https://github.com/puppeteer/puppeteer/commit/53c91348094dc0bce59086c98986c5d06a949d08))
- remove `error` const, change CustomError to PuppeteerError ([#11777](https://github.com/puppeteer/puppeteer/issues/11777)) ([b3bfdd2](https://github.com/puppeteer/puppeteer/commit/b3bfdd2024097be1974e28b3766419189b4a9fe0))
- remove add/removeEventListener in favor of on/off ([#11792](https://github.com/puppeteer/puppeteer/issues/11792)) ([f160874](https://github.com/puppeteer/puppeteer/commit/f1608743c83e8ce7b56aec98ccdddacc91b86179))
- remove devices in favor of KnownDevices ([#11787](https://github.com/puppeteer/puppeteer/issues/11787)) ([eb360e3](https://github.com/puppeteer/puppeteer/commit/eb360e3a762d9232a4972d4ec877b7d57a5b60c7))
- remove duplicate type names ([#11803](https://github.com/puppeteer/puppeteer/issues/11803)) ([514e2d5](https://github.com/puppeteer/puppeteer/commit/514e2d5241dc3a9027c96d739cfc99efc5a02783))
- remove InterceptResolutionStrategy ([#11788](https://github.com/puppeteer/puppeteer/issues/11788)) ([f18d447](https://github.com/puppeteer/puppeteer/commit/f18d44761cd1acc2e6b867e5eb2ebd753854e9ea))
- remove networkConditions in favor of PredefinedNetworkConditions ([#11806](https://github.com/puppeteer/puppeteer/issues/11806)) ([7564dfa](https://github.com/puppeteer/puppeteer/commit/7564dfa9110e44b1f50f5fb1543c5c7d8529c182))
- remove waitForTimeout ([#11780](https://github.com/puppeteer/puppeteer/issues/11780)) ([1900fa9](https://github.com/puppeteer/puppeteer/commit/1900fa94183e0a8654633a91f82b372ad068da71))
- rename createIncognitoBrowserContext to createBrowserContext ([#11834](https://github.com/puppeteer/puppeteer/issues/11834)) ([46a3ef2](https://github.com/puppeteer/puppeteer/commit/46a3ef2681456d604e775f578fa447a094200610))
- use ReadableStreams ([#11805](https://github.com/puppeteer/puppeteer/issues/11805)) ([84d9a94](https://github.com/puppeteer/puppeteer/commit/84d9a94d6228800e9f80914472ff2e5a4ee71b18))

## [21.11.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.10.0...puppeteer-v21.11.0) (2024-02-02)

### Features

- add outline to PDF generation ([#11779](https://github.com/puppeteer/puppeteer/issues/11779)) ([b99d478](https://github.com/puppeteer/puppeteer/commit/b99d478cd48adc261878836e04eac55ecc2890f2))
- **bidi:** implement UserContexts ([#11784](https://github.com/puppeteer/puppeteer/issues/11784)) ([2930a70](https://github.com/puppeteer/puppeteer/commit/2930a70c884ce6835ec6bcff27b32f7d273c8af0))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.10.0 to 21.11.0

### Bug Fixes

- use shareReplay for inflight requests ([#11810](https://github.com/puppeteer/puppeteer/issues/11810)) ([0f0813d](https://github.com/puppeteer/puppeteer/commit/0f0813db38aa0eb14d7514d725852d0cb66f4f0e))

## [21.10.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.9.0...puppeteer-v21.10.0) (2024-01-29)

### Features

- add experimental browser.debugInfo ([#11748](https://github.com/puppeteer/puppeteer/issues/11748)) ([f88e1da](https://github.com/puppeteer/puppeteer/commit/f88e1da6385bc72e9ffde8514c28e4a0ff9e396a))
- download chrome-headless-shell by default and use it for the old headless mode ([#11754](https://github.com/puppeteer/puppeteer/issues/11754)) ([ce894a2](https://github.com/puppeteer/puppeteer/commit/ce894a2ffce4bc44bd11f12d1f0543e003a97e02))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.9.0 to 21.10.0

### Bug Fixes

- set viewport for element screenshots ([#11772](https://github.com/puppeteer/puppeteer/issues/11772)) ([9cd6673](https://github.com/puppeteer/puppeteer/commit/9cd66731d148afff9c2f873c1383fbe367cc5fb2))

## [21.9.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.8.0...puppeteer-v21.9.0) (2024-01-24)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.8.0 to 21.9.0

### Features

- roll to Chrome 121.0.6167.85 (r1233107) ([#11743](https://github.com/puppeteer/puppeteer/issues/11743)) ([0eec94c](https://github.com/puppeteer/puppeteer/commit/0eec94cf57288528ecd0a084a71311b181864f7b))

## [21.8.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.7.0...puppeteer-v21.8.0) (2024-01-24)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.7.0 to 21.8.0

### Features

- roll to Chrome 120.0.6099.109 (r1217362) ([#11733](https://github.com/puppeteer/puppeteer/issues/11733)) ([415cfac](https://github.com/puppeteer/puppeteer/commit/415cfaca202126b64ff496e4318cae64c4f14e89))

### Bug Fixes

- expose function for Firefox BiDi ([#11660](https://github.com/puppeteer/puppeteer/issues/11660)) ([cf879b8](https://github.com/puppeteer/puppeteer/commit/cf879b82f6c10302fcafe186b315fe7807107c31))
- wait for WebDriver BiDi browser to close gracefully ([#11636](https://github.com/puppeteer/puppeteer/issues/11636)) ([cc3aeeb](https://github.com/puppeteer/puppeteer/commit/cc3aeeb6eae4663198466755f23746ef821408ae))

### Reverts

- refactor: adopt `core/UserContext` on `BidiBrowserContext` ([#11721](https://github.com/puppeteer/puppeteer/issues/11721)) ([d17a9df](https://github.com/puppeteer/puppeteer/commit/d17a9df0278be34c206701d8dfc1fb62af3637b3))

## [21.7.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.6.1...puppeteer-v21.7.0) (2024-01-04)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.9.0 to 1.9.1

### Features

- allow converting other targets to pages ([#11604](https://github.com/puppeteer/puppeteer/issues/11604)) ([66aa770](https://github.com/puppeteer/puppeteer/commit/66aa77003880a1458e14b47a3ed87856fd3a1933))
- support fetching request POST data ([#11598](https://github.com/puppeteer/puppeteer/issues/11598)) ([80143de](https://github.com/puppeteer/puppeteer/commit/80143def9606ec5f2018dde618c00784442c5c1d))
- support timeouts per CDP command ([#11595](https://github.com/puppeteer/puppeteer/issues/11595)) ([c660d40](https://github.com/puppeteer/puppeteer/commit/c660d4001d610854399d7ecb551c4eb56a7f840a))

### Bug Fixes

- change viewportHeight in screencast ([#11583](https://github.com/puppeteer/puppeteer/issues/11583)) ([107b833](https://github.com/puppeteer/puppeteer/commit/107b8337e5eebc5e31a57663ba1345be81fb486e))
- disable GFX sanity window for Firefox and enable WebDriver BiDi CI jobs for Windows ([#11578](https://github.com/puppeteer/puppeteer/issues/11578)) ([e41a265](https://github.com/puppeteer/puppeteer/commit/e41a2656d9e1f3f037b298457fbd6c6e08f5a371))
- improve reliability of exposeFunction ([#11600](https://github.com/puppeteer/puppeteer/issues/11600)) ([b0c5392](https://github.com/puppeteer/puppeteer/commit/b0c5392cb36eed2ed4ae4864587885b6059f4cfb))

## [21.6.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.6.0...puppeteer-v21.6.1) (2023-12-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.6.0 to 21.6.1

### Bug Fixes

- emulate if captureBeyondViewport is false ([#11525](https://github.com/puppeteer/puppeteer/issues/11525)) ([b6d1163](https://github.com/puppeteer/puppeteer/commit/b6d1163f7f33d80fd43fa4915789d3689ea2369f))
- ensure fission.bfcacheInParent is disabled for cdp in Firefox ([#11522](https://github.com/puppeteer/puppeteer/issues/11522)) ([b4a6524](https://github.com/puppeteer/puppeteer/commit/b4a65245b0ad01b2b634473ebb4d8bb2d7e420f7))

## [21.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.5.2...puppeteer-v21.6.0) (2023-12-05)

### Features

- BiDi implementation of `Puppeteer.connect` for Firefox ([#11451](https://github.com/puppeteer/puppeteer/issues/11451)) ([be081ba](https://github.com/puppeteer/puppeteer/commit/be081ba17a9bbac70c13cafa81f1038f0ecfda70))
- experimental WebDriver BiDi support with Firefox ([#11412](https://github.com/puppeteer/puppeteer/issues/11412)) ([8aba033](https://github.com/puppeteer/puppeteer/commit/8aba033dde1a306e37f6033d6f6ff36387e1aac3))
- implement the Puppeteer CLI ([#11344](https://github.com/puppeteer/puppeteer/issues/11344)) ([53fb69b](https://github.com/puppeteer/puppeteer/commit/53fb69bf7f2bf06fa4fd7bb6d3cf21382386f6e7))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.8.0 to 1.9.0

### Bug Fixes

- end WebDriver BiDi session on disconnect ([#11470](https://github.com/puppeteer/puppeteer/issues/11470)) ([a66d029](https://github.com/puppeteer/puppeteer/commit/a66d0296077a82179a2182281a5040fd96d3843c))
- remove CDP-specific preferences from defaults for Firefox ([#11477](https://github.com/puppeteer/puppeteer/issues/11477)) ([f8c9469](https://github.com/puppeteer/puppeteer/commit/f8c94699c7f5b15c7bb96f299c2c8217d74230cd))
- warn about launch Chrome using Node x64 on arm64 Macs ([#11471](https://github.com/puppeteer/puppeteer/issues/11471)) ([957a829](https://github.com/puppeteer/puppeteer/commit/957a8293bb1444fd51fd5673002a7781e8127c9d))

## [21.5.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.5.1...puppeteer-v21.5.2) (2023-11-15)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.5.1 to 21.5.2

### Bug Fixes

- add --disable-field-trial-config ([#11352](https://github.com/puppeteer/puppeteer/issues/11352)) ([cbc33be](https://github.com/puppeteer/puppeteer/commit/cbc33bea40b8801b8eeb3277fc15d04900715795))
- add --disable-infobars ([#11377](https://github.com/puppeteer/puppeteer/issues/11377)) ([0a41f8d](https://github.com/puppeteer/puppeteer/commit/0a41f8d01e85ff732fdd2e50468bc746d7bc6475))
- mitt types should not be exported ([#11371](https://github.com/puppeteer/puppeteer/issues/11371)) ([4bf2a09](https://github.com/puppeteer/puppeteer/commit/4bf2a09a13450c530b24288d65791fd5c4d4dce7))

## [21.5.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.5.0...puppeteer-v21.5.1) (2023-11-09)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.5.0 to 21.5.1

### Bug Fixes

- better debugging for WaitTask ([#11330](https://github.com/puppeteer/puppeteer/issues/11330)) ([d2480b0](https://github.com/puppeteer/puppeteer/commit/d2480b022d74b7071b515408a31c6e82448e3c9e))

## [21.5.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.4.1...puppeteer-v21.5.0) (2023-11-02)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.4.1 to 21.5.0

### Features

- roll to Chrome 119.0.6045.105 (r1204232) ([#11287](https://github.com/puppeteer/puppeteer/issues/11287)) ([325fa8b](https://github.com/puppeteer/puppeteer/commit/325fa8b1b16a9dafd5bb320e49984d24044fa3d7))

### Bug Fixes

- ignore unordered frames ([#11283](https://github.com/puppeteer/puppeteer/issues/11283)) ([ce4e485](https://github.com/puppeteer/puppeteer/commit/ce4e485d1b1e9d4e223890ee0fc2475a1ad71bc3))
- Type for ElementHandle.screenshot ([#11274](https://github.com/puppeteer/puppeteer/issues/11274)) ([22aeff1](https://github.com/puppeteer/puppeteer/commit/22aeff1eac9d22048330a16aa3c41293133911e4))

## [21.4.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.4.0...puppeteer-v21.4.1) (2023-10-23)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.4.0 to 21.4.1

### Bug Fixes

- do not pass --\{enable,disable}-features twice when user-provided ([#11230](https://github.com/puppeteer/puppeteer/issues/11230)) ([edec7d5](https://github.com/puppeteer/puppeteer/commit/edec7d53f8190381ade7db145ad7e7d6dba2ee13))
- remove circular import in IsolatedWorld ([#11228](https://github.com/puppeteer/puppeteer/issues/11228)) ([3edce3a](https://github.com/puppeteer/puppeteer/commit/3edce3aee9521654d7a285f4068a5e60bfb52245))
- remove import cycle ([#11227](https://github.com/puppeteer/puppeteer/issues/11227)) ([525f13c](https://github.com/puppeteer/puppeteer/commit/525f13cd18b39cc951a84aa51b2d852758e6f0d2))
- remove import cycle in connection ([#11225](https://github.com/puppeteer/puppeteer/issues/11225)) ([60f1b78](https://github.com/puppeteer/puppeteer/commit/60f1b788a6304504f504b0be9f02cb768e2803f8))
- remove import cycle in query handlers ([#11234](https://github.com/puppeteer/puppeteer/issues/11234)) ([954c75f](https://github.com/puppeteer/puppeteer/commit/954c75f9a9879e2e68935c17d7eb777b1f9f808a))
- remove more import cycles ([#11231](https://github.com/puppeteer/puppeteer/issues/11231)) ([b9ce89e](https://github.com/puppeteer/puppeteer/commit/b9ce89e460702ad85314685c600a4e5267f4db9b))
- typo in screencast error message ([#11213](https://github.com/puppeteer/puppeteer/issues/11213)) ([25b90b2](https://github.com/puppeteer/puppeteer/commit/25b90b2b542c4693150b67dc0c690b99f4ccfc95))

## [21.4.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.8...puppeteer-v21.4.0) (2023-10-20)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.7.1 to 1.8.0

### Features

- added tagged (accessible) PDFs option ([#11182](https://github.com/puppeteer/puppeteer/issues/11182)) ([0316863](https://github.com/puppeteer/puppeteer/commit/031686339136873c555a19ffb871f7140a2c39d9))
- enable tab targets ([#11099](https://github.com/puppeteer/puppeteer/issues/11099)) ([8324c16](https://github.com/puppeteer/puppeteer/commit/8324c1634883d97ed83f32a1e62acc9b5e64e0bd))
- implement screencasting ([#11084](https://github.com/puppeteer/puppeteer/issues/11084)) ([f060d46](https://github.com/puppeteer/puppeteer/commit/f060d467c00457e6be6878e0789d0df2ac4aae50))
- merge user-provided --\{disable,enable}-features in args ([#11152](https://github.com/puppeteer/puppeteer/issues/11152)) ([2b578e4](https://github.com/puppeteer/puppeteer/commit/2b578e4a096aa94d792cc2da2da41fee061a77b8)), closes [#11072](https://github.com/puppeteer/puppeteer/issues/11072)
- roll to Chrome 118.0.5993.70 (r1192594) ([#11123](https://github.com/puppeteer/puppeteer/issues/11123)) ([91d14c8](https://github.com/puppeteer/puppeteer/commit/91d14c8c86f5be48c8e0937fd209bea643d60b45))

### Bug Fixes

- `Page.waitForDevicePrompt` crash ([#11153](https://github.com/puppeteer/puppeteer/issues/11153)) ([257be15](https://github.com/puppeteer/puppeteer/commit/257be15d83a46038a65d47977d4d847c54506517))
- add InlineTextBox as a non-element a11y role ([#11142](https://github.com/puppeteer/puppeteer/issues/11142)) ([8aa6cb3](https://github.com/puppeteer/puppeteer/commit/8aa6cb37d2443ff7fe2a1fd5d5adafdde4e9d165))
- disable ProcessPerSiteUpToMainFrameThreshold in Chrome ([#11139](https://github.com/puppeteer/puppeteer/issues/11139)) ([9347aae](https://github.com/puppeteer/puppeteer/commit/9347aae12e996604cea871acc9d007cbf338542e))
- make sure discovery happens before auto-attach ([#11100](https://github.com/puppeteer/puppeteer/issues/11100)) ([9ce204e](https://github.com/puppeteer/puppeteer/commit/9ce204e27ed091bde5aa5bc9f82da41c80534bde))
- synchronize frame tree with the events processing ([#11112](https://github.com/puppeteer/puppeteer/issues/11112)) ([d63f0cf](https://github.com/puppeteer/puppeteer/commit/d63f0cfc61e8ba2233eee8b2f3b99d8619a0acaf))
- update TextQuerySelector cache on subtree update ([#11200](https://github.com/puppeteer/puppeteer/issues/11200)) ([4206e76](https://github.com/puppeteer/puppeteer/commit/4206e76c3e4647ea6290f16127764d1a2f337dcf))
- xpath queries should be atomic ([#11101](https://github.com/puppeteer/puppeteer/issues/11101)) ([6098bab](https://github.com/puppeteer/puppeteer/commit/6098bab2ba68276c85a974e17c9fe3bdac8c4c58))

## [21.3.8](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.7...puppeteer-v21.3.8) (2023-10-06)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.7 to 21.3.8

### Bug Fixes

- avoid double subscription to frame manager in Page ([#11091](https://github.com/puppeteer/puppeteer/issues/11091)) ([5887649](https://github.com/puppeteer/puppeteer/commit/5887649891ea9cf1d7b3afbcf7196620ceb20ab2))
- update file chooser events ([#11057](https://github.com/puppeteer/puppeteer/issues/11057)) ([317f820](https://github.com/puppeteer/puppeteer/commit/317f82055b2f4dd68db136a3d52c5712425fa339))

## [21.3.7](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.6...puppeteer-v21.3.7) (2023-10-05)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.6 to 21.3.7

### Bug Fixes

- roll to Chrome 117.0.5938.149 (r1181205) ([#11077](https://github.com/puppeteer/puppeteer/issues/11077)) ([0c0e516](https://github.com/puppeteer/puppeteer/commit/0c0e516d736665a27f7773f66a0f9c362daa73aa))

## [21.3.6](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.5...puppeteer-v21.3.6) (2023-09-28)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.5 to 21.3.6

### Bug Fixes

- remove the flag disabling bfcache ([#11047](https://github.com/puppeteer/puppeteer/issues/11047)) ([b0d7375](https://github.com/puppeteer/puppeteer/commit/b0d73755193e7c60deb70df120859b5db87e7817))

## [21.3.5](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.4...puppeteer-v21.3.5) (2023-09-26)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.4 to 21.3.5

### Bug Fixes

- set defaults in screenshot ([#11021](https://github.com/puppeteer/puppeteer/issues/11021)) ([ace1230](https://github.com/puppeteer/puppeteer/commit/ace1230e41aad6168dc85b9bc1f7c04d9dce5527))

## [21.3.4](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.3...puppeteer-v21.3.4) (2023-09-22)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.3 to 21.3.4

### Bug Fixes

- avoid structuredClone for Node 16 ([#11006](https://github.com/puppeteer/puppeteer/issues/11006)) ([25eca9a](https://github.com/puppeteer/puppeteer/commit/25eca9a747c122b3096b0f2d01b3323339d57dd9))

## [21.3.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.2...puppeteer-v21.3.3) (2023-09-22)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.2 to 21.3.3

### Bug Fixes

- do not export bidi and fix import from the entrypoint ([#10998](https://github.com/puppeteer/puppeteer/issues/10998)) ([88c78de](https://github.com/puppeteer/puppeteer/commit/88c78dea41eb7690d67343298c150194fe145763))

## [21.3.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.1...puppeteer-v21.3.2) (2023-09-22)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.1 to 21.3.2

### Bug Fixes

- handle missing detach events for restored bfcache targets ([#10967](https://github.com/puppeteer/puppeteer/issues/10967)) ([7bcdfcb](https://github.com/puppeteer/puppeteer/commit/7bcdfcb7e9e75feca0a8de692926ea25ca8fbed0))
- roll to Chrome 117.0.5938.92 (r1181205) ([#10989](https://github.com/puppeteer/puppeteer/issues/10989)) ([d048cd9](https://github.com/puppeteer/puppeteer/commit/d048cd965f0707dd9b2a3276f02c563b69f6fac4))

## [21.3.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.3.0...puppeteer-v21.3.1) (2023-09-19)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.3.0 to 21.3.1

### Bug Fixes

- make `CDPSessionEvent.SessionAttached` public ([#10941](https://github.com/puppeteer/puppeteer/issues/10941)) ([cfed7b9](https://github.com/puppeteer/puppeteer/commit/cfed7b93ec23e92ec11632f1cd90f00dac754739))

## [21.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.2.1...puppeteer-v21.3.0) (2023-09-19)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.2.1 to 21.3.0

### Features

- implement `Browser.connected` ([#10927](https://github.com/puppeteer/puppeteer/issues/10927)) ([a4345a4](https://github.com/puppeteer/puppeteer/commit/a4345a477f58541f5d95da11ffee74abe24c12bf))
- implement `BrowserContext.closed` ([#10928](https://github.com/puppeteer/puppeteer/issues/10928)) ([2292078](https://github.com/puppeteer/puppeteer/commit/2292078969fa46a27d5759989cd44a4d48beb310))
- implement improved Drag n' Drop APIs ([#10651](https://github.com/puppeteer/puppeteer/issues/10651)) ([9342bac](https://github.com/puppeteer/puppeteer/commit/9342bac2639702090f39fc1e3a97d43a934f3f0b))
- implement typed events ([#10889](https://github.com/puppeteer/puppeteer/issues/10889)) ([9b6f1de](https://github.com/puppeteer/puppeteer/commit/9b6f1de8b99445c661c5aebcf041fe90daf469b9))
- roll to Chrome 117.0.5938.62 (r1181205) ([#10893](https://github.com/puppeteer/puppeteer/issues/10893)) ([4b8d20d](https://github.com/puppeteer/puppeteer/commit/4b8d20d0edeccaa3028e0c1c0b63c022cfabcee2))

### Bug Fixes

- fix line/column number in errors ([#10926](https://github.com/puppeteer/puppeteer/issues/10926)) ([a0e57f7](https://github.com/puppeteer/puppeteer/commit/a0e57f7eb230ba6a659c2d418da8d3f67add2d00))
- handle frame manager init without unhandled rejection ([#10902](https://github.com/puppeteer/puppeteer/issues/10902)) ([ea14834](https://github.com/puppeteer/puppeteer/commit/ea14834fdf1c7c1afa45bdd1fb5339380f4631a2))
- remove explicit resource management from types ([#10918](https://github.com/puppeteer/puppeteer/issues/10918)) ([a1b1bff](https://github.com/puppeteer/puppeteer/commit/a1b1bffb7258f1dec3b0a2e9ce068baf2cc3db19))
- roll to Chrome 117.0.5938.88 (r1181205) ([#10920](https://github.com/puppeteer/puppeteer/issues/10920)) ([b7bcc9a](https://github.com/puppeteer/puppeteer/commit/b7bcc9a733a3ac376397a32c3f62eb68101bedf9))

## [21.2.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.2.0...puppeteer-v21.2.1) (2023-09-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.7.0 to 1.7.1

### Bug Fixes

- use supported node range for types ([#10896](https://github.com/puppeteer/puppeteer/issues/10896)) ([2d851c1](https://github.com/puppeteer/puppeteer/commit/2d851c1398e5efcdabdb5304dc78e68cbd3fadd2))

## [21.2.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.1.1...puppeteer-v21.2.0) (2023-09-12)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.1.1 to 21.2.0

### Features

- expose DevTools as a target ([#10812](https://github.com/puppeteer/puppeteer/issues/10812)) ([a540085](https://github.com/puppeteer/puppeteer/commit/a540085176d92bd160a12ebc54606dbacd064979))

### Bug Fixes

- add --disable-search-engine-choice-screen to default arguments ([#10880](https://github.com/puppeteer/puppeteer/issues/10880)) ([d08ad5f](https://github.com/puppeteer/puppeteer/commit/d08ad5fbbe3be4349dd6132c209895f8436ae9e6))
- apply viewport emulation to prerender targets ([#10804](https://github.com/puppeteer/puppeteer/issues/10804)) ([14f0ab7](https://github.com/puppeteer/puppeteer/commit/14f0ab7397053db5591823c716e142c684f25b44))
- implement `throwIfDetached` ([#10826](https://github.com/puppeteer/puppeteer/issues/10826)) ([538bb73](https://github.com/puppeteer/puppeteer/commit/538bb73ea7e280cacf15fc1d2100251d8e17f906))
- LifecycleWatcher sub frames handling ([#10841](https://github.com/puppeteer/puppeteer/issues/10841)) ([06c1588](https://github.com/puppeteer/puppeteer/commit/06c1588016e1ebef5ed8f079dc34507f6d781e07))
- make network manager multi session ([#10793](https://github.com/puppeteer/puppeteer/issues/10793)) ([085936b](https://github.com/puppeteer/puppeteer/commit/085936bd7e17ed5a8085311f5b212c7b9ca96a0d))
- make page.goBack work with bfcache in tab mode ([#10818](https://github.com/puppeteer/puppeteer/issues/10818)) ([22daf18](https://github.com/puppeteer/puppeteer/commit/22daf1861fc358acf4d84c360049736c22249f92))
- only a single disable features flag is allowed ([#10887](https://github.com/puppeteer/puppeteer/issues/10887)) ([4852e22](https://github.com/puppeteer/puppeteer/commit/4852e222b771ed9b95596657f70e45c1d5b9790d))
- trimCache should remove Firefox too ([#10872](https://github.com/puppeteer/puppeteer/issues/10872)) ([acdd7d3](https://github.com/puppeteer/puppeteer/commit/acdd7d3cd5529bc934edbb8479bdb950cc7d8a6a))

## [21.1.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.1.0...puppeteer-v21.1.1) (2023-08-28)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.1.0 to 21.1.1

### Bug Fixes

- **locators:** do not retry via catchError ([#10762](https://github.com/puppeteer/puppeteer/issues/10762)) ([8f9388f](https://github.com/puppeteer/puppeteer/commit/8f9388f2ce5220ad9b3c05fb3f3d9a86fac894dc))

## [21.1.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.0.3...puppeteer-v21.1.0) (2023-08-18)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.6.0 to 1.7.0

### Features

- roll to Chrome 116.0.5845.96 (r1160321) ([#10735](https://github.com/puppeteer/puppeteer/issues/10735)) ([e12b558](https://github.com/puppeteer/puppeteer/commit/e12b558f505aab13f38030a7b748261bdeadc48b))

### Bug Fixes

- locator.fill should work for textareas ([#10737](https://github.com/puppeteer/puppeteer/issues/10737)) ([fc08a7d](https://github.com/puppeteer/puppeteer/commit/fc08a7dd54226878300f3a4b52fb16aeb5cc93e8))
- relative ordering of events and command responses should be ensured ([#10725](https://github.com/puppeteer/puppeteer/issues/10725)) ([81ecb60](https://github.com/puppeteer/puppeteer/commit/81ecb60190f89389abb6d8834158f38ff7317ec8))

## [21.0.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.0.1...puppeteer-v21.0.2) (2023-08-08)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.5.0 to 1.5.1

### Bug Fixes

- destroy puppeteer utility on context destruction ([#10672](https://github.com/puppeteer/puppeteer/issues/10672)) ([8b8770c](https://github.com/puppeteer/puppeteer/commit/8b8770c004ba842496e0ca4845642fe82a211051))
- roll to Chrome 115.0.5790.170 (r1148114) ([#10677](https://github.com/puppeteer/puppeteer/issues/10677)) ([e5af57e](https://github.com/puppeteer/puppeteer/commit/e5af57ebd0187c296bc44426c1b931f57442732e))

## [21.0.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.0.0...puppeteer-v21.0.1) (2023-08-03)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 21.0.0 to 21.0.1

### Bug Fixes

- use handle frame instead of page ([#10676](https://github.com/puppeteer/puppeteer/issues/10676)) ([1b44b91](https://github.com/puppeteer/puppeteer/commit/1b44b911d3633df89bd6106aaf7accb49230934d))

## [21.0.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.9.0...puppeteer-v21.0.0) (2023-08-02)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.4.6 to 1.5.0

### ⚠ BREAKING CHANGES

- use Target for filters ([#10601](https://github.com/puppeteer/puppeteer/issues/10601))

### Features

- add page.createCDPSession method ([#10515](https://github.com/puppeteer/puppeteer/issues/10515)) ([d0c5b8e](https://github.com/puppeteer/puppeteer/commit/d0c5b8e08905f3802705a1a90d7cc8fa04bc82db))
- implement `Locator.prototype.filter` ([#10631](https://github.com/puppeteer/puppeteer/issues/10631)) ([e73d35d](https://github.com/puppeteer/puppeteer/commit/e73d35def0718468fe854ac2ef5f4a8beafb2fb3))
- implement `Locator.prototype.map` ([#10630](https://github.com/puppeteer/puppeteer/issues/10630)) ([47eecf5](https://github.com/puppeteer/puppeteer/commit/47eecf5bb11daba0114ad04282beb01c85eb9405))
- implement `Locator.prototype.wait` ([#10629](https://github.com/puppeteer/puppeteer/issues/10629)) ([5d34d42](https://github.com/puppeteer/puppeteer/commit/5d34d42d1536cbe7cf2ba1aa8670d909c4e6a6fc))
- implement `Locator.prototype.waitHandle` ([#10650](https://github.com/puppeteer/puppeteer/issues/10650)) ([fdada74](https://github.com/puppeteer/puppeteer/commit/fdada74ba7265b3571ebdf60ae301b64d13a8226))
- implement function locators ([#10632](https://github.com/puppeteer/puppeteer/issues/10632)) ([6ad92f7](https://github.com/puppeteer/puppeteer/commit/6ad92f7f84f477b22674f52f0a145a500c3aa152))
- implement immutable locator operations ([#10638](https://github.com/puppeteer/puppeteer/issues/10638)) ([34be28d](https://github.com/puppeteer/puppeteer/commit/34be28db5d9971cf16d9741b0141357df3cbf74c))

### Bug Fixes

- remove typescript from peer dependencies ([#10593](https://github.com/puppeteer/puppeteer/issues/10593)) ([c60572a](https://github.com/puppeteer/puppeteer/commit/c60572a1ca36ea5946d287bd629ac31798d84cb0))
- roll to Chrome 115.0.5790.102 (r1148114) ([#10608](https://github.com/puppeteer/puppeteer/issues/10608)) ([8649c53](https://github.com/puppeteer/puppeteer/commit/8649c53a706e5a09ae5e16849eb29a793cec5bec))

### Code Refactoring

- use Target for filters ([#10601](https://github.com/puppeteer/puppeteer/issues/10601)) ([44712d1](https://github.com/puppeteer/puppeteer/commit/44712d1e6efcb3fa49c27b1195d17c0c1c92a0ca))

## [20.9.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.8.3...puppeteer-v20.9.0) (2023-07-20)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.4.5 to 1.4.6

### Features

- add autofill support ([#10565](https://github.com/puppeteer/puppeteer/issues/10565)) ([6c9306a](https://github.com/puppeteer/puppeteer/commit/6c9306a72e0f7195a4a6c300645f6089845c9abc))
- roll to Chrome 115.0.5790.98 (r1148114) ([#10584](https://github.com/puppeteer/puppeteer/issues/10584)) ([830f926](https://github.com/puppeteer/puppeteer/commit/830f926d486675701720b5c147f597364f3e8f7b))

### Bug Fixes

- update the target to ES2022 ([#10574](https://github.com/puppeteer/puppeteer/issues/10574)) ([88439f9](https://github.com/puppeteer/puppeteer/commit/88439f913ed4159cdc8be573f2dbda0b1f615301))

## [20.8.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.8.2...puppeteer-v20.8.3) (2023-07-18)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.8.2 to 20.8.3

### Bug Fixes

- **locators:** reject the race if there are only failures ([#10567](https://github.com/puppeteer/puppeteer/issues/10567)) ([e3dd596](https://github.com/puppeteer/puppeteer/commit/e3dd5968cae196b64d958c161fed3d1b39aed3f6))
- prevent erroneous new main frame ([#10549](https://github.com/puppeteer/puppeteer/issues/10549)) ([cb46413](https://github.com/puppeteer/puppeteer/commit/cb46413d87f10970f4088b7d58e02a65c5ccd27e))

## [20.8.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.8.0...puppeteer-v20.8.1) (2023-07-11)

### Bug Fixes

- remove test metadata files ([#10520](https://github.com/puppeteer/puppeteer/issues/10520)) ([cbf4f2a](https://github.com/puppeteer/puppeteer/commit/cbf4f2a66912f24849ae8c88fc1423851dcc4aa7))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.4.3 to 1.4.4

## [20.8.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.7.4...puppeteer-v20.8.0) (2023-07-06)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.7.4 to 20.8.0

### Features

- **screenshot:** enable optimizeForSpeed ([#10492](https://github.com/puppeteer/puppeteer/issues/10492)) ([87aaed4](https://github.com/puppeteer/puppeteer/commit/87aaed4807e5240dec7b25273e44c1ce5e884336))

### Bug Fixes

- add an internal page.locatorRace ([#10512](https://github.com/puppeteer/puppeteer/issues/10512)) ([56a97dd](https://github.com/puppeteer/puppeteer/commit/56a97dd2fb1cbf36e4f3344f7d22afd6e7ef2380))

## [20.7.4](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.7.3...puppeteer-v20.7.4) (2023-06-29)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.4.2 to 1.4.3

### Bug Fixes

- fix escaping algo for P selectors ([#10474](https://github.com/puppeteer/puppeteer/issues/10474)) ([84a956f](https://github.com/puppeteer/puppeteer/commit/84a956f56ba9ce74e9dd0f95ff40fdd14be87b1d))
- fix the util import in Connection.ts ([#10450](https://github.com/puppeteer/puppeteer/issues/10450)) ([61f4525](https://github.com/puppeteer/puppeteer/commit/61f4525ae306810404af9083d2e7440403c02722))

## [20.7.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.7.2...puppeteer-v20.7.3) (2023-06-20)

### Bug Fixes

- add parenthesis to JS values in interpolateFunction ([#10426](https://github.com/puppeteer/puppeteer/issues/10426)) ([fbdcc0d](https://github.com/puppeteer/puppeteer/commit/fbdcc0d6469abe7115723347a9f161628074d41e))
- added clipboard permission that was not exposed ([#10119](https://github.com/puppeteer/puppeteer/issues/10119)) ([c06e15f](https://github.com/puppeteer/puppeteer/commit/c06e15fb5bd7ec21db2d883ccf63ef8fe98c7f4d))
- include src into published package ([#10415](https://github.com/puppeteer/puppeteer/issues/10415)) ([d1ffad0](https://github.com/puppeteer/puppeteer/commit/d1ffad059ae66104842b92dc814d362c123b9646))
- WaitForNetworkIdle and Deferred.race ([#10411](https://github.com/puppeteer/puppeteer/issues/10411)) ([138cc5c](https://github.com/puppeteer/puppeteer/commit/138cc5c961da698bf7ca635c9947058df4b2ec72))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.4.1 to 1.4.2

## [20.7.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.7.1...puppeteer-v20.7.2) (2023-06-16)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.7.1 to 20.7.2

### Bug Fixes

- roll to Chrome 114.0.5735.133 (r1135570) ([#10384](https://github.com/puppeteer/puppeteer/issues/10384)) ([9311558](https://github.com/puppeteer/puppeteer/commit/93115587c94278e0a5309429d3f23a52ed24e22d))

## [20.7.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.7.0...puppeteer-v20.7.1) (2023-06-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.7.0 to 20.7.1

### Bug Fixes

- avoid importing puppeteer-core.js ([#10376](https://github.com/puppeteer/puppeteer/issues/10376)) ([3171c12](https://github.com/puppeteer/puppeteer/commit/3171c12a0c16b283e6b65b1ed3d801b089a6e28b))

## [20.7.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.6.0...puppeteer-v20.7.0) (2023-06-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.6.0 to 20.7.0

### Features

- add `reset` to mouse ([#10340](https://github.com/puppeteer/puppeteer/issues/10340)) ([35aedc0](https://github.com/puppeteer/puppeteer/commit/35aedc0dbbd80818e6f83ff9f0777dc3ea2588f0))

### Bug Fixes

- Locator.scroll in race ([#10363](https://github.com/puppeteer/puppeteer/issues/10363)) ([ba28724](https://github.com/puppeteer/puppeteer/commit/ba28724952b41ea653830a75efc4c73b234ea354))
- mark CDPSessionOnMessageObject as internal ([#10373](https://github.com/puppeteer/puppeteer/issues/10373)) ([7cb6059](https://github.com/puppeteer/puppeteer/commit/7cb6059bcc36f8dc3739a8df9119c658146ac100))
- specify the context id when adding bindings ([#10366](https://github.com/puppeteer/puppeteer/issues/10366)) ([c2d3488](https://github.com/puppeteer/puppeteer/commit/c2d3488ad8c0453312557ba28e6ade9c32464f17))

## [20.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.5.0...puppeteer-v20.6.0) (2023-06-09)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.5.0 to 20.6.0

### Features

- add `page.removeExposedFunction` ([#10297](https://github.com/puppeteer/puppeteer/issues/10297)) ([4d0dbbc](https://github.com/puppeteer/puppeteer/commit/4d0dbbc517f388a3fe984ec569bc1bad28d91494))
- **chrome:** roll to Chrome 114.0.5735.45 (r1135570) ([#10302](https://github.com/puppeteer/puppeteer/issues/10302)) ([021402d](https://github.com/puppeteer/puppeteer/commit/021402d1363accabc05f75ea1004451a90e1dfca))
- implement Locator.race ([#10337](https://github.com/puppeteer/puppeteer/issues/10337)) ([9c35e9a](https://github.com/puppeteer/puppeteer/commit/9c35e9ab1f92e99aab8dabcd17f687befd6aad81))
- implement Locators ([#10305](https://github.com/puppeteer/puppeteer/issues/10305)) ([1f978f5](https://github.com/puppeteer/puppeteer/commit/1f978f5fc5f0580859ad423e952595979f50d5a9))

### Bug Fixes

- content() not showing comments outside html tag ([#10293](https://github.com/puppeteer/puppeteer/issues/10293)) ([9abd48a](https://github.com/puppeteer/puppeteer/commit/9abd48a062a4a30fb93d0b555f2fa03d3dc410f3))
- ensure stack trace contains one line ([#10317](https://github.com/puppeteer/puppeteer/issues/10317)) ([bc0b04b](https://github.com/puppeteer/puppeteer/commit/bc0b04beef3244280e6569a233173d512adaa9d8))
- roll to Chrome 114.0.5735.90 (r1135570) ([#10329](https://github.com/puppeteer/puppeteer/issues/10329)) ([60acefc](https://github.com/puppeteer/puppeteer/commit/60acefc1d6d719ed6c5053d6b9ad734306d08c4a))
- send capabilities property in session.new command ([#10311](https://github.com/puppeteer/puppeteer/issues/10311)) ([e8d044c](https://github.com/puppeteer/puppeteer/commit/e8d044cb8dcb689cc066ffa18a1e3c9366f57902))

## [20.5.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.4.0...puppeteer-v20.5.0) (2023-05-31)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.4.0 to 1.4.1

### Features

- Page.removeScriptToEvaluateOnNewDocument ([#10250](https://github.com/puppeteer/puppeteer/issues/10250)) ([b5a124f](https://github.com/puppeteer/puppeteer/commit/b5a124ff738a03fa7eb5755b441af5b773447449))

### Bug Fixes

- bind trimCache to the instance ([#10270](https://github.com/puppeteer/puppeteer/issues/10270)) ([50e72a4](https://github.com/puppeteer/puppeteer/commit/50e72a4d1164af7d53e31b8b83117f695ede7ae4))

## [20.4.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.3.0...puppeteer-v20.4.0) (2023-05-24)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.3.0 to 1.4.0

### Features

- Page.setBypassServiceWorker ([#10229](https://github.com/puppeteer/puppeteer/issues/10229)) ([81f73a5](https://github.com/puppeteer/puppeteer/commit/81f73a55f31892e55219ef9d37e235e988731fc1))

### Bug Fixes

- stacktraces should not throw errors ([#10231](https://github.com/puppeteer/puppeteer/issues/10231)) ([557ec24](https://github.com/puppeteer/puppeteer/commit/557ec24cfc084440197da67581bf9782f10eb346))

## [20.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.2.1...puppeteer-v20.3.0) (2023-05-22)

### Features

- add an ability to trim cache for Puppeteer ([#10199](https://github.com/puppeteer/puppeteer/issues/10199)) ([1ad32ec](https://github.com/puppeteer/puppeteer/commit/1ad32ec9948ca3e07e15548a562c8f3c633b3dc3))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.2.1 to 20.3.0

### Bug Fixes

- ElementHandle dragAndDrop should fail when interception is disabled ([#10209](https://github.com/puppeteer/puppeteer/issues/10209)) ([bcf5fd8](https://github.com/puppeteer/puppeteer/commit/bcf5fd87aeeb822203c3388e8aa6dadaa0107690))

## [20.2.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.2.0...puppeteer-v20.2.1) (2023-05-15)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.2.0 to 1.3.0

### Bug Fixes

- use encode/decodeURIComponent ([#10183](https://github.com/puppeteer/puppeteer/issues/10183)) ([d0c68ff](https://github.com/puppeteer/puppeteer/commit/d0c68ff002df37907968d3b999a8273590ac7c97))

## [20.2.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.1.2...puppeteer-v20.2.0) (2023-05-11)

### Bug Fixes

- downloadPath should be used by the install script ([#10163](https://github.com/puppeteer/puppeteer/issues/10163)) ([4398f66](https://github.com/puppeteer/puppeteer/commit/4398f66f281f1ffe5be81b529fc4751edfaf761d))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.1.0 to 1.2.0

### Features

- implement detailed errors for evaluation ([#10114](https://github.com/puppeteer/puppeteer/issues/10114)) ([317fa73](https://github.com/puppeteer/puppeteer/commit/317fa732f920382f9b3f6dea4e31ed31b04e25da))

## [20.1.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.1.0...puppeteer-v20.1.1) (2023-05-05)

### Bug Fixes

- rename PUPPETEER_DOWNLOAD_HOST to PUPPETEER_DOWNLOAD_BASE_URL ([#10130](https://github.com/puppeteer/puppeteer/issues/10130)) ([9758cae](https://github.com/puppeteer/puppeteer/commit/9758cae029f90908c4b5340561d9c51c26aa2f21))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 1.0.0 to 1.0.1

## [20.1.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v20.0.0...puppeteer-v20.1.0) (2023-05-03)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 20.0.0 to 20.1.0

### Features

- **chrome:** roll to Chrome 113.0.5672.63 (r1121455) ([#10116](https://github.com/puppeteer/puppeteer/issues/10116)) ([19f4334](https://github.com/puppeteer/puppeteer/commit/19f43348a884edfc3e73ab60e41a9757239df013))

## [20.0.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.11.1...puppeteer-v20.0.0) (2023-05-02)

### ⚠ BREAKING CHANGES

- drop support for node14 ([#10019](https://github.com/puppeteer/puppeteer/issues/10019))
- switch to Chrome for Testing instead of Chromium ([#10054](https://github.com/puppeteer/puppeteer/issues/10054))

### Features

- add AbortSignal to waitForFunction ([#10078](https://github.com/puppeteer/puppeteer/issues/10078)) ([4dd4cb9](https://github.com/puppeteer/puppeteer/commit/4dd4cb929242a6b1a621fd461edd3167d40e1c4c))
- drop support for node14 ([#10019](https://github.com/puppeteer/puppeteer/issues/10019)) ([7405d65](https://github.com/puppeteer/puppeteer/commit/7405d6585aa09b240fbab09aa360674d4442b3d9))
- switch to Chrome for Testing instead of Chromium ([#10054](https://github.com/puppeteer/puppeteer/issues/10054)) ([df4d60c](https://github.com/puppeteer/puppeteer/commit/df4d60c187aa11c4ad783827242e9511f4ec2aab))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 0.5.0 to 1.0.0

### Bug Fixes

- use AbortSignal.throwIfAborted ([#10105](https://github.com/puppeteer/puppeteer/issues/10105)) ([575f00a](https://github.com/puppeteer/puppeteer/commit/575f00a31d0278f7ff27096e770ff84399cd9993))

## [19.11.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.11.0...puppeteer-v19.11.1) (2023-04-25)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.11.0 to 19.11.1

### Bug Fixes

- implement click `count` ([#10069](https://github.com/puppeteer/puppeteer/issues/10069)) ([8124a7d](https://github.com/puppeteer/puppeteer/commit/8124a7d5bfc1cfa8cb579271f78ce586efc62b8e))
- implement flag for disabling headless warning ([#10073](https://github.com/puppeteer/puppeteer/issues/10073)) ([cfe9bbc](https://github.com/puppeteer/puppeteer/commit/cfe9bbc852d014b31c754950590b6b6c96573eeb))

## [19.11.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.10.1...puppeteer-v19.11.0) (2023-04-24)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.10.1 to 19.11.0

### Features

- add warn for `headless: true` ([#10039](https://github.com/puppeteer/puppeteer/issues/10039)) ([23d6a95](https://github.com/puppeteer/puppeteer/commit/23d6a95cf10c90f8aba2b12d7b02a73072e20382))

### Bug Fixes

- infer last pressed button in mouse move ([#10067](https://github.com/puppeteer/puppeteer/issues/10067)) ([a6eaac4](https://github.com/puppeteer/puppeteer/commit/a6eaac4c39d4b0ab3ab1a3c2f319a70fde393edb))

## [19.10.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.10.0...puppeteer-v19.10.1) (2023-04-21)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 0.4.1 to 0.5.0

### Bug Fixes

- move fs.js to the node folder ([#10055](https://github.com/puppeteer/puppeteer/issues/10055)) ([704624e](https://github.com/puppeteer/puppeteer/commit/704624eb2045a7e38ed14044d6863a2871e9d7e2))

## [19.10.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.9.1...puppeteer-v19.10.0) (2023-04-20)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.9.1 to 19.10.0

### Features

- support AbortController in waitForSelector ([#10018](https://github.com/puppeteer/puppeteer/issues/10018)) ([9109b76](https://github.com/puppeteer/puppeteer/commit/9109b76276c9d86a2c521c72fc5b7189979279ca))
- **webworker:** expose WebWorker.client ([#10042](https://github.com/puppeteer/puppeteer/issues/10042)) ([c125128](https://github.com/puppeteer/puppeteer/commit/c12512822a546e7bfdefd2c68f020aab2a308f4f))

### Bug Fixes

- continue requests without network instrumentation ([#10046](https://github.com/puppeteer/puppeteer/issues/10046)) ([8283823](https://github.com/puppeteer/puppeteer/commit/8283823cb860528a938e84cb5ba2b5f4cf980e83))
- install bindings once ([#10049](https://github.com/puppeteer/puppeteer/issues/10049)) ([690aec1](https://github.com/puppeteer/puppeteer/commit/690aec1b5cb4e7e574abde9c533c6c0954e6f1aa))

## [19.9.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.9.0...puppeteer-v19.9.1) (2023-04-17)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.9.0 to 19.9.1

### Bug Fixes

- improve mouse actions ([#10021](https://github.com/puppeteer/puppeteer/issues/10021)) ([34db39e](https://github.com/puppeteer/puppeteer/commit/34db39e4474efee9d4579743026c3d6b6c8e494b))

## [19.9.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.8.5...puppeteer-v19.9.0) (2023-04-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 0.4.0 to 0.4.1

### Features

- add ElementHandle.isVisible and ElementHandle.isHidden ([#10007](https://github.com/puppeteer/puppeteer/issues/10007)) ([26c81b7](https://github.com/puppeteer/puppeteer/commit/26c81b7408a98cb9ef1aac9b57a038b699e6d518))
- add ElementHandle.scrollIntoView ([#10005](https://github.com/puppeteer/puppeteer/issues/10005)) ([0d556a7](https://github.com/puppeteer/puppeteer/commit/0d556a71d6bcd5da501724ccbb4ce0be433768df))

### Bug Fixes

- make isIntersectingViewport work with SVG elements ([#10004](https://github.com/puppeteer/puppeteer/issues/10004)) ([656b562](https://github.com/puppeteer/puppeteer/commit/656b562c7488d4976a7a53264feef508c6b629dd))

### Performance Improvements

- amortize handle iterator ([#10002](https://github.com/puppeteer/puppeteer/issues/10002)) ([ab27f73](https://github.com/puppeteer/puppeteer/commit/ab27f738c9abb56f6083d02f7f45d2b8da9fc3f3))

## [19.8.5](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.8.4...puppeteer-v19.8.5) (2023-04-06)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 0.3.3 to 0.4.0

### Bug Fixes

- add filter to setDiscoverTargets for Firefox ([#9693](https://github.com/puppeteer/puppeteer/issues/9693)) ([c09764e](https://github.com/puppeteer/puppeteer/commit/c09764e4c43d7a62096f430b598d63f2b688e860))

## [19.8.4](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.8.3...puppeteer-v19.8.4) (2023-04-06)

### Bug Fixes

- ignore extraInfo events if the response is served from cache ([#9983](https://github.com/puppeteer/puppeteer/issues/9983)) ([e7265c9](https://github.com/puppeteer/puppeteer/commit/e7265c9aa94e749de5745e5e98d45d4659f19d30))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - @puppeteer/browsers bumped from 0.3.2 to 0.3.3

## [19.8.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.8.2...puppeteer-v19.8.3) (2023-04-03)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.8.1 to 19.8.3
    - @puppeteer/browsers bumped from 0.3.1 to 0.3.2

### Bug Fixes

- use shadowRoot for tree walker ([#9950](https://github.com/puppeteer/puppeteer/issues/9950)) ([728547d](https://github.com/puppeteer/puppeteer/commit/728547d4608e8c601e209ede860493b1986da174))

## [19.8.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.8.0...puppeteer-v19.8.1) (2023-03-28)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.8.0 to 19.8.1

### Bug Fixes

- increase the default protocol timeout ([#9928](https://github.com/puppeteer/puppeteer/issues/9928)) ([4465f4b](https://github.com/puppeteer/puppeteer/commit/4465f4bd1900afc0b049ac863f4e372453a0c234))

## [19.8.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.7.5...puppeteer-v19.8.0) (2023-03-24)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.7.5 to 19.8.0

### Features

- add Page.waitForDevicePrompt ([#9299](https://github.com/puppeteer/puppeteer/issues/9299)) ([a5149d5](https://github.com/puppeteer/puppeteer/commit/a5149d52f54036a27a411bc070902b1eb3a7a629))
- **chromium:** roll to Chromium 112.0.5614.0 (r1108766) ([#9841](https://github.com/puppeteer/puppeteer/issues/9841)) ([eddb1f6](https://github.com/puppeteer/puppeteer/commit/eddb1f6ec3958b79fea297123f7621eb7beaff04))

### Bug Fixes

- fallback to CSS ([#9876](https://github.com/puppeteer/puppeteer/issues/9876)) ([e6ec9c2](https://github.com/puppeteer/puppeteer/commit/e6ec9c295847fa0f1ec240952f0f2523bb13b7c8))
- implement protocol-level timeouts ([#9877](https://github.com/puppeteer/puppeteer/issues/9877)) ([510b36c](https://github.com/puppeteer/puppeteer/commit/510b36c50001c95783b00dc8af42b5801ec57358))
- viewport.deviceScaleFactor can be set to system default ([#9911](https://github.com/puppeteer/puppeteer/issues/9911)) ([022c909](https://github.com/puppeteer/puppeteer/commit/022c90932658d13ff4ae4aa51d26716f5dbe54ac))
- waitForNavigation issue with aborted events ([#9883](https://github.com/puppeteer/puppeteer/issues/9883)) ([36c029b](https://github.com/puppeteer/puppeteer/commit/36c029b38d64a10590bfc74ecea255a58914b0d2))

## [19.7.5](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.7.4...puppeteer-v19.7.5) (2023-03-14)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.7.4 to 19.7.5

### Bug Fixes

- sort elements based on selector matching algorithm ([#9836](https://github.com/puppeteer/puppeteer/issues/9836)) ([9044609](https://github.com/puppeteer/puppeteer/commit/9044609be3ea78c650420533e7f6f40b83cedd99))

### Performance Improvements

- use `querySelector*` for pure CSS selectors ([#9835](https://github.com/puppeteer/puppeteer/issues/9835)) ([8aea8e0](https://github.com/puppeteer/puppeteer/commit/8aea8e047103b72c0238dde8e4777acf7897ddaa))

## [19.7.4](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.7.3...puppeteer-v19.7.4) (2023-03-10)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.7.3 to 19.7.4

### Bug Fixes

- call \_detach on disconnect ([#9807](https://github.com/puppeteer/puppeteer/issues/9807)) ([bc1a04d](https://github.com/puppeteer/puppeteer/commit/bc1a04def8f699ad245c12ec69ac176e3e7e888d))
- restore rimraf for puppeteer-core code ([#9815](https://github.com/puppeteer/puppeteer/issues/9815)) ([cefc4ea](https://github.com/puppeteer/puppeteer/commit/cefc4eab4750d2c1209eb36ca44f6963a4a6bf4c))
- update troubleshooting guide links in errors ([#9821](https://github.com/puppeteer/puppeteer/issues/9821)) ([0165f06](https://github.com/puppeteer/puppeteer/commit/0165f06deef9e45862fd127a205ade5ad30ddaa3))

## [19.7.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.7.2...puppeteer-v19.7.3) (2023-03-06)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.7.2 to 19.7.3

### Bug Fixes

- update dependencies ([#9781](https://github.com/puppeteer/puppeteer/issues/9781)) ([364b23f](https://github.com/puppeteer/puppeteer/commit/364b23f8b5c7b04974f233c58e5ded9a8f912ff2))

## [19.7.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.7.1...puppeteer-v19.7.2) (2023-02-20)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.7.1 to 19.7.2

### Bug Fixes

- bump chromium-bidi to a version that does not declare mitt as a peer dependency ([#9701](https://github.com/puppeteer/puppeteer/issues/9701)) ([82916c1](https://github.com/puppeteer/puppeteer/commit/82916c102b2c399093ba9019e272207b5ce81849))

## [19.7.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.7.0...puppeteer-v19.7.1) (2023-02-15)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.7.0 to 19.7.1

### Bug Fixes

- fix circularity on JSHandle interface ([#9661](https://github.com/puppeteer/puppeteer/issues/9661)) ([eb13863](https://github.com/puppeteer/puppeteer/commit/eb138635d661d3cdaf2940959fece5aca482178a))
- make chromium-bidi an opt peer dep ([#9667](https://github.com/puppeteer/puppeteer/issues/9667)) ([c6054ac](https://github.com/puppeteer/puppeteer/commit/c6054ac1a56c08ee7bf01321878699b7b4ab4e0b))

## [19.7.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.6.3...puppeteer-v19.7.0) (2023-02-13)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.6.3 to 19.7.0

### Features

- add touchstart, touchmove and touchend methods ([#9622](https://github.com/puppeteer/puppeteer/issues/9622)) ([c8bb11a](https://github.com/puppeteer/puppeteer/commit/c8bb11adfcf1537032730a91baa3c36a6e324926))
- **chromium:** roll to Chromium 111.0.5556.0 (r1095492) ([#9656](https://github.com/puppeteer/puppeteer/issues/9656)) ([df59d01](https://github.com/puppeteer/puppeteer/commit/df59d010c20644da06eb4c4e28a11c4eea164aba))

### Bug Fixes

- `page.goto` error throwing on 40x/50x responses with an empty body ([#9523](https://github.com/puppeteer/puppeteer/issues/9523)) ([#9577](https://github.com/puppeteer/puppeteer/issues/9577)) ([ddb0cc1](https://github.com/puppeteer/puppeteer/commit/ddb0cc174d2a14c0948dcdaf9bae78620937c667))

## [19.6.3](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.6.2...puppeteer-v19.6.3) (2023-02-01)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.6.2 to 19.6.3

### Bug Fixes

- ignore not found contexts for console messages ([#9595](https://github.com/puppeteer/puppeteer/issues/9595)) ([390685b](https://github.com/puppeteer/puppeteer/commit/390685bbe52c22b686fc0e3119b4ac7b1073c581))
- restore WaitTask terminate condition ([#9612](https://github.com/puppeteer/puppeteer/issues/9612)) ([e16cbc6](https://github.com/puppeteer/puppeteer/commit/e16cbc6626cffd40d0caa30801620e7293455006))

## [19.6.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.6.1...puppeteer-v19.6.2) (2023-01-27)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.6.1 to 19.6.2

### Bug Fixes

- atomically get Puppeteer utilities ([#9597](https://github.com/puppeteer/puppeteer/issues/9597)) ([050a7b0](https://github.com/puppeteer/puppeteer/commit/050a7b062415ebaf10bcb71c405143eacc4e5d4b))

## [19.6.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.6.0...puppeteer-v19.6.1) (2023-01-26)

### Bug Fixes

- don't clean up previous browser versions ([#9568](https://github.com/puppeteer/puppeteer/issues/9568)) ([344bc2a](https://github.com/puppeteer/puppeteer/commit/344bc2af62e4068fe2cb8162d4b6c8242aac843b)), closes [#9533](https://github.com/puppeteer/puppeteer/issues/9533)
- mimic rejection for PuppeteerUtil on early call ([#9589](https://github.com/puppeteer/puppeteer/issues/9589)) ([1980de9](https://github.com/puppeteer/puppeteer/commit/1980de91a161523c7098a79919b20e6d8d2e5d81))
- **revert:** use LazyArg for puppeteer utilities ([#9590](https://github.com/puppeteer/puppeteer/issues/9590)) ([6edd996](https://github.com/puppeteer/puppeteer/commit/6edd99676827de2c83f7a858e4f903b1c34e7d35))
- use LazyArg for puppeteer utilities ([#9575](https://github.com/puppeteer/puppeteer/issues/9575)) ([496658f](https://github.com/puppeteer/puppeteer/commit/496658f02945b53096483f36cb3d64556cff045e))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.6.0 to 19.6.1

## [19.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.5.2...puppeteer-v19.6.0) (2023-01-23)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.5.2 to 19.6.0

### Features

- **chromium:** roll to Chromium 110.0.5479.0 (r1083080) ([#9500](https://github.com/puppeteer/puppeteer/issues/9500)) ([06e816b](https://github.com/puppeteer/puppeteer/commit/06e816bbfa7b9ca84284929f654de7288c51169d)), closes [#9470](https://github.com/puppeteer/puppeteer/issues/9470)
- **page:** Adding support for referrerPolicy in `page.goto` ([#9561](https://github.com/puppeteer/puppeteer/issues/9561)) ([e3d69ec](https://github.com/puppeteer/puppeteer/commit/e3d69ec554beeac37bd206a21921d2fed3cb968c))

### Bug Fixes

- firefox revision resolution should not update chrome revision ([#9507](https://github.com/puppeteer/puppeteer/issues/9507)) ([f59bbf4](https://github.com/puppeteer/puppeteer/commit/f59bbf4014644dec6f395713e8403939aebe06ea)), closes [#9461](https://github.com/puppeteer/puppeteer/issues/9461)
- improve screenshot method types ([#9529](https://github.com/puppeteer/puppeteer/issues/9529)) ([6847f88](https://github.com/puppeteer/puppeteer/commit/6847f8835f28e97edba6fce76a4cbf85561482b9))

## [19.5.2](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.5.1...puppeteer-v19.5.2) (2023-01-11)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.5.1 to 19.5.2

### Bug Fixes

- make sure browser fetcher in launchers uses configuration ([#9493](https://github.com/puppeteer/puppeteer/issues/9493)) ([df55439](https://github.com/puppeteer/puppeteer/commit/df554397b51e97aea2765b325f9a887b50b9263a)), closes [#9470](https://github.com/puppeteer/puppeteer/issues/9470)

## [19.5.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.5.0...puppeteer-v19.5.1) (2023-01-11)

### Bug Fixes

- use puppeteer node for installation script ([#9489](https://github.com/puppeteer/puppeteer/issues/9489)) ([9bf90d9](https://github.com/puppeteer/puppeteer/commit/9bf90d9f4b5aeab06f8b433714712cad3259d36e))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.5.0 to 19.5.1

## [19.5.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.4.1...puppeteer-v19.5.0) (2023-01-05)

### Features

- add element validation ([#9352](https://github.com/puppeteer/puppeteer/issues/9352)) ([c7a063a](https://github.com/puppeteer/puppeteer/commit/c7a063a15274856184356e15f2ae4be41191d309))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.4.1 to 19.5.0

### Bug Fixes

- **puppeteer-core:** target interceptor is not async ([#9430](https://github.com/puppeteer/puppeteer/issues/9430)) ([e3e9cc6](https://github.com/puppeteer/puppeteer/commit/e3e9cc622ac32f2067b6e74b5e8706c63169a157))

## [19.4.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.4.0...puppeteer-v19.4.1) (2022-12-16)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.4.0 to 19.4.1

### Bug Fixes

- improve a11y snapshot handling if the tree is not correct ([#9405](https://github.com/puppeteer/puppeteer/issues/9405)) ([02fe501](https://github.com/puppeteer/puppeteer/commit/02fe50194e60bd14c3a82539473a0313ab88c766)), closes [#9404](https://github.com/puppeteer/puppeteer/issues/9404)
- remove oopif expectations and fix oopif flakiness ([#9375](https://github.com/puppeteer/puppeteer/issues/9375)) ([810e0cd](https://github.com/puppeteer/puppeteer/commit/810e0cd74ecef353cfa43746c18bd5f580a3233d))

## [19.4.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.3.0...puppeteer-v19.4.0) (2022-12-07)

### Features

- ability to send headers via ws connection to browser in node.js environment ([#9314](https://github.com/puppeteer/puppeteer/issues/9314)) ([937fffa](https://github.com/puppeteer/puppeteer/commit/937fffaedc340ea12d5f6636d3ba6598cb22e397)), closes [#7218](https://github.com/puppeteer/puppeteer/issues/7218)
- **chromium:** roll to Chromium 109.0.5412.0 (r1069273) ([#9364](https://github.com/puppeteer/puppeteer/issues/9364)) ([1875da6](https://github.com/puppeteer/puppeteer/commit/1875da61916df1fbcf98047858c01075bd9af189)), closes [#9233](https://github.com/puppeteer/puppeteer/issues/9233)
- **puppeteer-core:** keydown supports commands ([#9357](https://github.com/puppeteer/puppeteer/issues/9357)) ([b7ebc5d](https://github.com/puppeteer/puppeteer/commit/b7ebc5d9bb9b9940ffdf470e51d007f709587d40))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.3.0 to 19.4.0

### Bug Fixes

- **puppeteer-core:** avoid type instantiation errors ([#9370](https://github.com/puppeteer/puppeteer/issues/9370)) ([17f31a9](https://github.com/puppeteer/puppeteer/commit/17f31a9ee408ca5a08fe6dbceb8915e710156bd3)), closes [#9369](https://github.com/puppeteer/puppeteer/issues/9369)

## [19.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.2.2...puppeteer-v19.3.0) (2022-11-23)

### Miscellaneous Chores

- **puppeteer:** Synchronize puppeteer versions

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.2.2 to 19.3.0

### Features

- **puppeteer-core:** Infer element type from complex selector ([#9253](https://github.com/puppeteer/puppeteer/issues/9253)) ([bef1061](https://github.com/puppeteer/puppeteer/commit/bef1061c064e5135d86a48fffd7278f3e7f4a29e))
- **puppeteer-core:** update Chrome launcher flags ([#9239](https://github.com/puppeteer/puppeteer/issues/9239)) ([ae87bfc](https://github.com/puppeteer/puppeteer/commit/ae87bfc2b4361556e3660a1de2c6db348ce663ae))

### Bug Fixes

- remove boundary conditions for visibility ([#9249](https://github.com/puppeteer/puppeteer/issues/9249)) ([e003513](https://github.com/puppeteer/puppeteer/commit/e003513c0c049aad38e374a16dc96c3e54ab0de5))

## [19.2.2](https://github.com/puppeteer/puppeteer/compare/v19.2.1...v19.2.2) (2022-11-03)

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.2.1 to ^19.2.2

### Bug Fixes

- update missing product message ([#9207](https://github.com/puppeteer/puppeteer/issues/9207)) ([29f47e2](https://github.com/puppeteer/puppeteer/commit/29f47e2e150ff7bfd89e38a4ce4ca34eac7f2fdf))

## [19.2.1](https://github.com/puppeteer/puppeteer/compare/v19.2.0...v19.2.1) (2022-10-28)

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.2.0 to ^19.2.1

### Bug Fixes

- resolve navigation requests when request fails ([#9178](https://github.com/puppeteer/puppeteer/issues/9178)) ([c11297b](https://github.com/puppeteer/puppeteer/commit/c11297baa5124eb89f7686c3eb446d2ba1b7123a)), closes [#9175](https://github.com/puppeteer/puppeteer/issues/9175)

## [19.2.0](https://github.com/puppeteer/puppeteer/compare/v19.1.2...v19.2.0) (2022-10-26)

### Features

- **chromium:** roll to Chromium 108.0.5351.0 (r1056772) ([#9153](https://github.com/puppeteer/puppeteer/issues/9153)) ([e78a4e8](https://github.com/puppeteer/puppeteer/commit/e78a4e89c22bb1180e72d180c16b39673ff9125e))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.1.1 to ^19.2.0

## [19.1.2](https://github.com/puppeteer/puppeteer/compare/v19.1.1...v19.1.2) (2022-10-25)

### Bug Fixes

- skip browser download ([#9160](https://github.com/puppeteer/puppeteer/issues/9160)) ([2245d7d](https://github.com/puppeteer/puppeteer/commit/2245d7d6ed0630ee1ad985dcbd48354772924750))

## [19.1.1](https://github.com/puppeteer/puppeteer/compare/v19.1.0...v19.1.1) (2022-10-21)

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.1.0 to ^19.1.1

### Bug Fixes

- update documentation on configuring puppeteer ([#9150](https://github.com/puppeteer/puppeteer/issues/9150)) ([f07ad2c](https://github.com/puppeteer/puppeteer/commit/f07ad2c6616ecd2a959b0c1a65b167ba77611d61))

## [19.1.0](https://github.com/puppeteer/puppeteer/compare/v19.0.0...v19.1.0) (2022-10-21)

### Features

- expose browser context id ([#9134](https://github.com/puppeteer/puppeteer/issues/9134)) ([122778a](https://github.com/puppeteer/puppeteer/commit/122778a1f8b60e0dcc6f0ffcb2097e95ae98f4a3)), closes [#9132](https://github.com/puppeteer/puppeteer/issues/9132)
- use configuration files ([#9140](https://github.com/puppeteer/puppeteer/issues/9140)) ([ec20174](https://github.com/puppeteer/puppeteer/commit/ec201744f077987b288e3dff52c0906fe700f6fb)), closes [#9128](https://github.com/puppeteer/puppeteer/issues/9128)

### Bug Fixes

- update `BrowserFetcher` deprecation message ([#9141](https://github.com/puppeteer/puppeteer/issues/9141)) ([efcbc97](https://github.com/puppeteer/puppeteer/commit/efcbc97c60e4cfd49a9ed25a900f6133d06b290b))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 19.0.0 to ^19.1.0

## [19.0.0](https://github.com/puppeteer/puppeteer/compare/v18.2.1...v19.0.0) (2022-10-14)

### ⚠ BREAKING CHANGES

- use `~/.cache/puppeteer` for browser downloads (#9095)
- deprecate `createBrowserFetcher` in favor of `BrowserFetcher` (#9079)
- refactor custom query handler API (#9078)
- remove `puppeteer.devices` in favor of `KnownDevices` (#9075)
- deprecate indirect network condition imports (#9074)
- deprecate indirect error imports (#9072)

### Features

- add ability to collect JS code coverage at the function level ([#9027](https://github.com/puppeteer/puppeteer/issues/9027)) ([a032583](https://github.com/puppeteer/puppeteer/commit/a032583b6c9b469bda699bca200b180206d61247))
- deprecate `createBrowserFetcher` in favor of `BrowserFetcher` ([#9079](https://github.com/puppeteer/puppeteer/issues/9079)) ([7294dfe](https://github.com/puppeteer/puppeteer/commit/7294dfe9c6c3b224f95ba6d59b5ef33d379fd09a)), closes [#8999](https://github.com/puppeteer/puppeteer/issues/8999)
- use `~/.cache/puppeteer` for browser downloads ([#9095](https://github.com/puppeteer/puppeteer/issues/9095)) ([3df375b](https://github.com/puppeteer/puppeteer/commit/3df375baedad64b8773bb1e1e6f81b604ed18989))

### Bug Fixes

- deprecate indirect error imports ([#9072](https://github.com/puppeteer/puppeteer/issues/9072)) ([9f4f43a](https://github.com/puppeteer/puppeteer/commit/9f4f43a28b06787a1cf97efe904ccfe7237dffdd))
- deprecate indirect network condition imports ([#9074](https://github.com/puppeteer/puppeteer/issues/9074)) ([41d0122](https://github.com/puppeteer/puppeteer/commit/41d0122b94f41b308536c48ced345dec8c272a49))
- refactor custom query handler API ([#9078](https://github.com/puppeteer/puppeteer/issues/9078)) ([1847704](https://github.com/puppeteer/puppeteer/commit/1847704789e2888c755de8c739d567364b8ad645))
- remove `puppeteer.devices` in favor of `KnownDevices` ([#9075](https://github.com/puppeteer/puppeteer/issues/9075)) ([87c08fd](https://github.com/puppeteer/puppeteer/commit/87c08fd86a79b63308ad8d46c5f7acd1927505f8))
- remove viewport conditions in `waitForSelector` ([#9087](https://github.com/puppeteer/puppeteer/issues/9087)) ([acbc599](https://github.com/puppeteer/puppeteer/commit/acbc59999bf800eeac75c4045b75a32b4357c79e))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 18.2.1 to ^19.0.0

## [18.2.1](https://github.com/puppeteer/puppeteer/compare/v18.2.0...v18.2.1) (2022-10-06)

### Bug Fixes

- add README to package during prepack ([#9057](https://github.com/puppeteer/puppeteer/issues/9057)) ([9374e23](https://github.com/puppeteer/puppeteer/commit/9374e23d3da5e40378461ed08db24649730a445a))
- waitForRequest works with async predicate ([#9058](https://github.com/puppeteer/puppeteer/issues/9058)) ([8f6b2c9](https://github.com/puppeteer/puppeteer/commit/8f6b2c9b7c219d405c954bf7af082d3d29fd48ff))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 18.2.0 to ^18.2.1

## [18.2.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v18.1.0...puppeteer-v18.2.0) (2022-10-05)

### Features

- separate puppeteer and puppeteer-core ([#9023](https://github.com/puppeteer/puppeteer/issues/9023)) ([f42336c](https://github.com/puppeteer/puppeteer/commit/f42336cf83982332829ca7e14ee48d8676e11545))

### Dependencies

- The following workspace dependencies were updated
  - dependencies
    - puppeteer-core bumped from 18.1.0 to ^18.2.0

## [18.1.0](https://github.com/puppeteer/puppeteer/compare/v18.0.5...v18.1.0) (2022-10-05)

### Features

- **chromium:** roll to Chromium 107.0.5296.0 (r1045629) ([#9039](https://github.com/puppeteer/puppeteer/issues/9039)) ([022fbde](https://github.com/puppeteer/puppeteer/commit/022fbde85e067e8c419cf42dd571f9a1187c343c))

## [18.0.5](https://github.com/puppeteer/puppeteer/compare/v18.0.4...v18.0.5) (2022-09-22)

### Bug Fixes

- add missing npm config environment variable ([#8996](https://github.com/puppeteer/puppeteer/issues/8996)) ([7c1be20](https://github.com/puppeteer/puppeteer/commit/7c1be20aef46aaf5029732a580ec65aa8008aa9c))

## [18.0.4](https://github.com/puppeteer/puppeteer/compare/v18.0.3...v18.0.4) (2022-09-21)

### Bug Fixes

- hardcode binding names ([#8993](https://github.com/puppeteer/puppeteer/issues/8993)) ([7e20554](https://github.com/puppeteer/puppeteer/commit/7e2055433e79ef20f6dcdf02f92e1d64564b7d33))

## [18.0.3](https://github.com/puppeteer/puppeteer/compare/v18.0.2...v18.0.3) (2022-09-20)

### Bug Fixes

- change injected.ts imports ([#8987](https://github.com/puppeteer/puppeteer/issues/8987)) ([10a114d](https://github.com/puppeteer/puppeteer/commit/10a114d36f2add90860950f61b3f8b93258edb5c))

## [18.0.2](https://github.com/puppeteer/puppeteer/compare/v18.0.1...v18.0.2) (2022-09-19)

### Bug Fixes

- mark internal objects ([#8984](https://github.com/puppeteer/puppeteer/issues/8984)) ([181a148](https://github.com/puppeteer/puppeteer/commit/181a148269fce1575f5e37056929ecdec0517586))

## [18.0.1](https://github.com/puppeteer/puppeteer/compare/v18.0.0...v18.0.1) (2022-09-19)

### Bug Fixes

- internal lazy params ([#8982](https://github.com/puppeteer/puppeteer/issues/8982)) ([d504597](https://github.com/puppeteer/puppeteer/commit/d5045976a6dd321bbd265b84c2474ff1ad5d0b77))

## [18.0.0](https://github.com/puppeteer/puppeteer/compare/v17.1.3...v18.0.0) (2022-09-19)

### ⚠ BREAKING CHANGES

- fix bounding box visibility conditions (#8954)

### Features

- add text query handler ([#8956](https://github.com/puppeteer/puppeteer/issues/8956)) ([633e7cf](https://github.com/puppeteer/puppeteer/commit/633e7cfdf99d42f420d0af381394bd1f6ac7bcd1))

### Bug Fixes

- fix bounding box visibility conditions ([#8954](https://github.com/puppeteer/puppeteer/issues/8954)) ([ac9929d](https://github.com/puppeteer/puppeteer/commit/ac9929d80f6f7d4905a39183ae235500e29b4f53))
- suppress init errors if the target is closed ([#8947](https://github.com/puppeteer/puppeteer/issues/8947)) ([cfaaa5e](https://github.com/puppeteer/puppeteer/commit/cfaaa5e2c07e5f98baeb7de99e303aa840a351e8))
- use win64 version of chromium when on arm64 windows ([#8927](https://github.com/puppeteer/puppeteer/issues/8927)) ([64843b8](https://github.com/puppeteer/puppeteer/commit/64843b88853210314677ab1b434729513ce615a7))

## [17.1.3](https://github.com/puppeteer/puppeteer/compare/v17.1.2...v17.1.3) (2022-09-08)

### Bug Fixes

- FirefoxLauncher should not use BrowserFetcher in puppeteer-core ([#8920](https://github.com/puppeteer/puppeteer/issues/8920)) ([f2e8de7](https://github.com/puppeteer/puppeteer/commit/f2e8de777fc5d547778fdc6cac658add84ed4082)), closes [#8919](https://github.com/puppeteer/puppeteer/issues/8919)
- linux arm64 check on windows arm ([#8917](https://github.com/puppeteer/puppeteer/issues/8917)) ([f02b926](https://github.com/puppeteer/puppeteer/commit/f02b926245e28b5671087c051dbdbb3165696f08)), closes [#8915](https://github.com/puppeteer/puppeteer/issues/8915)

## [17.1.2](https://github.com/puppeteer/puppeteer/compare/v17.1.1...v17.1.2) (2022-09-07)

### Bug Fixes

- add missing code coverage ranges that span only a single character ([#8911](https://github.com/puppeteer/puppeteer/issues/8911)) ([0c577b9](https://github.com/puppeteer/puppeteer/commit/0c577b9bf8855dc0ccb6098cd43a25c528f6d7f5))
- add Page.getDefaultTimeout getter ([#8903](https://github.com/puppeteer/puppeteer/issues/8903)) ([3240095](https://github.com/puppeteer/puppeteer/commit/32400954c50cbddc48468ad118c3f8a47653b9d3)), closes [#8901](https://github.com/puppeteer/puppeteer/issues/8901)
- don't detect project root for puppeteer-core ([#8907](https://github.com/puppeteer/puppeteer/issues/8907)) ([b4f5ea1](https://github.com/puppeteer/puppeteer/commit/b4f5ea1167a60c870194c70d22f5372ada5b7c4c)), closes [#8896](https://github.com/puppeteer/puppeteer/issues/8896)
- support scale for screenshot clips ([#8908](https://github.com/puppeteer/puppeteer/issues/8908)) ([260e428](https://github.com/puppeteer/puppeteer/commit/260e4282275ab1d05c86e5643e2a02c01f269a9c)), closes [#5329](https://github.com/puppeteer/puppeteer/issues/5329)
- work around a race in waitForFileChooser ([#8905](https://github.com/puppeteer/puppeteer/issues/8905)) ([053d960](https://github.com/puppeteer/puppeteer/commit/053d960fb593e514e7914d7da9af436afc39a12f)), closes [#6040](https://github.com/puppeteer/puppeteer/issues/6040)

## [17.1.1](https://github.com/puppeteer/puppeteer/compare/v17.1.0...v17.1.1) (2022-09-05)

### Bug Fixes

- restore deferred promise debugging ([#8895](https://github.com/puppeteer/puppeteer/issues/8895)) ([7b42250](https://github.com/puppeteer/puppeteer/commit/7b42250c7bb91ac873307acda493726ffc4c54a8))

## [17.1.0](https://github.com/puppeteer/puppeteer/compare/v17.0.0...v17.1.0) (2022-09-02)

### Features

- **chromium:** roll to Chromium 106.0.5249.0 (r1036745) ([#8869](https://github.com/puppeteer/puppeteer/issues/8869)) ([6e9a47a](https://github.com/puppeteer/puppeteer/commit/6e9a47a6faa06d241dec0bcf7bcdf49370517008))

### Bug Fixes

- allow getting a frame from an elementhandle ([#8875](https://github.com/puppeteer/puppeteer/issues/8875)) ([3732757](https://github.com/puppeteer/puppeteer/commit/3732757450b4363041ccbacc3b236289a156abb0))
- typos in documentation ([#8858](https://github.com/puppeteer/puppeteer/issues/8858)) ([8d95a9b](https://github.com/puppeteer/puppeteer/commit/8d95a9bc920b98820aa655ad4eb2d8fd9b2b893a))
- use the timeout setting in waitForFileChooser ([#8856](https://github.com/puppeteer/puppeteer/issues/8856)) ([f477b46](https://github.com/puppeteer/puppeteer/commit/f477b46f212da9206102da695697760eea539f05))

## [17.0.0](https://github.com/puppeteer/puppeteer/compare/v16.2.0...v17.0.0) (2022-08-26)

### ⚠ BREAKING CHANGES

- remove `root` from `WaitForSelectorOptions` (#8848)
- internalize execution context (#8844)

### Bug Fixes

- allow multiple navigations to happen in LifecycleWatcher ([#8826](https://github.com/puppeteer/puppeteer/issues/8826)) ([341b669](https://github.com/puppeteer/puppeteer/commit/341b669a5e45ecbb9ffb0f28c45b520660f27ad2)), closes [#8811](https://github.com/puppeteer/puppeteer/issues/8811)
- internalize execution context ([#8844](https://github.com/puppeteer/puppeteer/issues/8844)) ([2f33237](https://github.com/puppeteer/puppeteer/commit/2f33237d0443de77d58dca4454b0c9a1d2b57d03))
- remove `root` from `WaitForSelectorOptions` ([#8848](https://github.com/puppeteer/puppeteer/issues/8848)) ([1155c8e](https://github.com/puppeteer/puppeteer/commit/1155c8eac85b176c3334cc3d98adfe7d943dfbe6))
- remove deferred promise timeouts ([#8835](https://github.com/puppeteer/puppeteer/issues/8835)) ([202ffce](https://github.com/puppeteer/puppeteer/commit/202ffce0aa4f34dba35fbb8e7d740af16efee35f)), closes [#8832](https://github.com/puppeteer/puppeteer/issues/8832)

## [16.2.0](https://github.com/puppeteer/puppeteer/compare/v16.1.1...v16.2.0) (2022-08-18)

### Features

- add Khmer (Cambodian) language support ([#8809](https://github.com/puppeteer/puppeteer/issues/8809)) ([34f8737](https://github.com/puppeteer/puppeteer/commit/34f873721804d57a5faf3eab8ef50340c69ed180))

### Bug Fixes

- handle service workers in extensions ([#8807](https://github.com/puppeteer/puppeteer/issues/8807)) ([2a0eefb](https://github.com/puppeteer/puppeteer/commit/2a0eefb99f0ae00dacc9e768a253308c0d18a4c3)), closes [#8800](https://github.com/puppeteer/puppeteer/issues/8800)

## [16.1.1](https://github.com/puppeteer/puppeteer/compare/v16.1.0...v16.1.1) (2022-08-16)

### Bug Fixes

- custom sessions should not emit targetcreated events ([#8788](https://github.com/puppeteer/puppeteer/issues/8788)) ([3fad05d](https://github.com/puppeteer/puppeteer/commit/3fad05d333b79f41a7b58582c4ca493200bb5a79)), closes [#8787](https://github.com/puppeteer/puppeteer/issues/8787)
- deprecate `ExecutionContext` ([#8792](https://github.com/puppeteer/puppeteer/issues/8792)) ([b5da718](https://github.com/puppeteer/puppeteer/commit/b5da718e2e4a2004a36cf23cad555e1fc3b50333))
- deprecate `root` in `WaitForSelectorOptions` ([#8795](https://github.com/puppeteer/puppeteer/issues/8795)) ([65a5ce8](https://github.com/puppeteer/puppeteer/commit/65a5ce8464c56fcc55e5ac3ed490f31311bbe32a))
- deprecate `waitForTimeout` ([#8793](https://github.com/puppeteer/puppeteer/issues/8793)) ([8f612d5](https://github.com/puppeteer/puppeteer/commit/8f612d5ff855d48ae4b38bdaacf2a8fbda8e9ce8))
- make sure there is a check for targets when timeout=0 ([#8765](https://github.com/puppeteer/puppeteer/issues/8765)) ([c23cdb7](https://github.com/puppeteer/puppeteer/commit/c23cdb73a7b113c1dd29f7e4a7a61326422c4080)), closes [#8763](https://github.com/puppeteer/puppeteer/issues/8763)
- resolve navigation flakiness ([#8768](https://github.com/puppeteer/puppeteer/issues/8768)) ([2580347](https://github.com/puppeteer/puppeteer/commit/2580347b50091d172b2a5591138a2e41ede072fe)), closes [#8644](https://github.com/puppeteer/puppeteer/issues/8644)
- specify Puppeteer version for Chromium 105.0.5173.0 ([#8766](https://github.com/puppeteer/puppeteer/issues/8766)) ([b5064b7](https://github.com/puppeteer/puppeteer/commit/b5064b7b8bd3bd9eb481b6807c65d9d06d23b9dd))
- use targetFilter in puppeteer.launch ([#8774](https://github.com/puppeteer/puppeteer/issues/8774)) ([ee2540b](https://github.com/puppeteer/puppeteer/commit/ee2540baefeced44f6b336f2b979af5c3a4cb040)), closes [#8772](https://github.com/puppeteer/puppeteer/issues/8772)

## [16.1.0](https://github.com/puppeteer/puppeteer/compare/v16.0.0...v16.1.0) (2022-08-06)

### Features

- use an `xpath` query handler ([#8730](https://github.com/puppeteer/puppeteer/issues/8730)) ([5cf9b4d](https://github.com/puppeteer/puppeteer/commit/5cf9b4de8d50bd056db82bcaa23279b72c9313c5))

### Bug Fixes

- resolve target manager init if no existing targets detected ([#8748](https://github.com/puppeteer/puppeteer/issues/8748)) ([8cb5043](https://github.com/puppeteer/puppeteer/commit/8cb5043868f69cdff7f34f1cfe0c003ff09e281b)), closes [#8747](https://github.com/puppeteer/puppeteer/issues/8747)
- specify the target filter in setDiscoverTargets ([#8742](https://github.com/puppeteer/puppeteer/issues/8742)) ([49193cb](https://github.com/puppeteer/puppeteer/commit/49193cbf1c17f16f0ca59a9fd2ebf306f812f52b))

## [16.0.0](https://github.com/puppeteer/puppeteer/compare/v15.5.0...v16.0.0) (2022-08-02)

### ⚠ BREAKING CHANGES

- With Chromium, Puppeteer will now attach to page/iframe targets immediately to allow reliable configuration of targets.

### Features

- add Dockerfile ([#8315](https://github.com/puppeteer/puppeteer/issues/8315)) ([936ed86](https://github.com/puppeteer/puppeteer/commit/936ed8607ec0c3798d2b22b590d0be0ad361a888))
- detect Firefox in connect() automatically ([#8718](https://github.com/puppeteer/puppeteer/issues/8718)) ([2abd772](https://github.com/puppeteer/puppeteer/commit/2abd772c9c3d2b86deb71541eaac41aceef94356))
- use CDP's auto-attach mechanism ([#8520](https://github.com/puppeteer/puppeteer/issues/8520)) ([2cbfdeb](https://github.com/puppeteer/puppeteer/commit/2cbfdeb0ca388a45cedfae865266230e1291bd29))

### Bug Fixes

- address flakiness in frame handling ([#8688](https://github.com/puppeteer/puppeteer/issues/8688)) ([6f81b23](https://github.com/puppeteer/puppeteer/commit/6f81b23728a511f7b89eaa2b8f850b22d6c4ab24))
- disable AcceptCHFrame ([#8706](https://github.com/puppeteer/puppeteer/issues/8706)) ([96d9608](https://github.com/puppeteer/puppeteer/commit/96d9608d1de17877414a649a0737661894dd96c8)), closes [#8479](https://github.com/puppeteer/puppeteer/issues/8479)
- use loaderId to reduce test flakiness ([#8717](https://github.com/puppeteer/puppeteer/issues/8717)) ([d2f6db2](https://github.com/puppeteer/puppeteer/commit/d2f6db20735342bb3f419e85adbd51ed10470044))

## [15.5.0](https://github.com/puppeteer/puppeteer/compare/v15.4.2...v15.5.0) (2022-07-21)

### Features

- **chromium:** roll to Chromium 105.0.5173.0 (r1022525) ([#8682](https://github.com/puppeteer/puppeteer/issues/8682)) ([f1b8ad3](https://github.com/puppeteer/puppeteer/commit/f1b8ad3269286800d31818ea4b6b3ee23f7437c3))

## [15.4.2](https://github.com/puppeteer/puppeteer/compare/v15.4.1...v15.4.2) (2022-07-21)

### Bug Fixes

- taking a screenshot with null viewport should be possible ([#8680](https://github.com/puppeteer/puppeteer/issues/8680)) ([2abb9f0](https://github.com/puppeteer/puppeteer/commit/2abb9f0c144779d555ecbf337a759440d0282cba)), closes [#8673](https://github.com/puppeteer/puppeteer/issues/8673)

## [15.4.1](https://github.com/puppeteer/puppeteer/compare/v15.4.0...v15.4.1) (2022-07-21)

### Bug Fixes

- import URL ([#8670](https://github.com/puppeteer/puppeteer/issues/8670)) ([34ab5ca](https://github.com/puppeteer/puppeteer/commit/34ab5ca50353ffb6a6345a8984b724a6f42fb726))

## [15.4.0](https://github.com/puppeteer/puppeteer/compare/v15.3.2...v15.4.0) (2022-07-13)

### Features

- expose the page getter on Frame ([#8657](https://github.com/puppeteer/puppeteer/issues/8657)) ([af08c5c](https://github.com/puppeteer/puppeteer/commit/af08c5c90380c853e8257a51298bfed4b0635779))

### Bug Fixes

- ignore \*.tsbuildinfo ([#8662](https://github.com/puppeteer/puppeteer/issues/8662)) ([edcdf21](https://github.com/puppeteer/puppeteer/commit/edcdf217cefbf31aee5a2f571abac429dd81f3a0))

## [15.3.2](https://github.com/puppeteer/puppeteer/compare/v15.3.1...v15.3.2) (2022-07-08)

### Bug Fixes

- cache dynamic imports ([#8652](https://github.com/puppeteer/puppeteer/issues/8652)) ([1de0383](https://github.com/puppeteer/puppeteer/commit/1de0383abf6be31cf06faede3e59b087a2958227))
- expose a RemoteObject getter ([#8642](https://github.com/puppeteer/puppeteer/issues/8642)) ([d0c4291](https://github.com/puppeteer/puppeteer/commit/d0c42919956bd36ad7993a0fc1de86e886e39f62)), closes [#8639](https://github.com/puppeteer/puppeteer/issues/8639)
- **page:** fix page.#scrollIntoViewIfNeeded method ([#8631](https://github.com/puppeteer/puppeteer/issues/8631)) ([b47f066](https://github.com/puppeteer/puppeteer/commit/b47f066c2c068825e3b65cfe17b6923c77ad30b9))

## [15.3.1](https://github.com/puppeteer/puppeteer/compare/v15.3.0...v15.3.1) (2022-07-06)

### Bug Fixes

- extends `ElementHandle` to `Node`s ([#8552](https://github.com/puppeteer/puppeteer/issues/8552)) ([5ff205d](https://github.com/puppeteer/puppeteer/commit/5ff205dc8b659eb8864b4b1862105d21dd334c8f))

## [15.3.0](https://github.com/puppeteer/puppeteer/compare/v15.2.0...v15.3.0) (2022-07-01)

### Features

- add documentation ([#8593](https://github.com/puppeteer/puppeteer/issues/8593)) ([066f440](https://github.com/puppeteer/puppeteer/commit/066f440ba7bdc9aca9423d7205adf36f2858bd78))

### Bug Fixes

- remove unused imports ([#8613](https://github.com/puppeteer/puppeteer/issues/8613)) ([0cf4832](https://github.com/puppeteer/puppeteer/commit/0cf4832878731ffcfc84570315f326eb851d7629))

## [15.2.0](https://github.com/puppeteer/puppeteer/compare/v15.1.1...v15.2.0) (2022-06-29)

### Features

- add fromSurface option to page.screenshot ([#8496](https://github.com/puppeteer/puppeteer/issues/8496)) ([79e1198](https://github.com/puppeteer/puppeteer/commit/79e11985ba44b72b1ad6b8cd861fe316f1945e64))
- export public types only ([#8584](https://github.com/puppeteer/puppeteer/issues/8584)) ([7001322](https://github.com/puppeteer/puppeteer/commit/7001322cd1cf9f77ee2c370d50a6707e7aaad72d))

### Bug Fixes

- clean up tmp profile dirs when browser is closed ([#8580](https://github.com/puppeteer/puppeteer/issues/8580)) ([9787a1d](https://github.com/puppeteer/puppeteer/commit/9787a1d8df7768017b36d42327faab402695c4bb))

## [15.1.1](https://github.com/puppeteer/puppeteer/compare/v15.1.0...v15.1.1) (2022-06-25)

### Bug Fixes

- export `ElementHandle` ([e0198a7](https://github.com/puppeteer/puppeteer/commit/e0198a79e06c8bb72dde554db0246a3db5fec4c2))

## [15.1.0](https://github.com/puppeteer/puppeteer/compare/v15.0.2...v15.1.0) (2022-06-24)

### Features

- **chromium:** roll to Chromium 104.0.5109.0 (r1011831) ([#8569](https://github.com/puppeteer/puppeteer/issues/8569)) ([fb7d31e](https://github.com/puppeteer/puppeteer/commit/fb7d31e3698428560e1f654d33782d241192f48f))

## [15.0.2](https://github.com/puppeteer/puppeteer/compare/v15.0.1...v15.0.2) (2022-06-24)

### Bug Fixes

- CSS coverage should work with empty stylesheets ([#8570](https://github.com/puppeteer/puppeteer/issues/8570)) ([383e855](https://github.com/puppeteer/puppeteer/commit/383e8558477fae7708734ab2160ef50f385e2983)), closes [#8535](https://github.com/puppeteer/puppeteer/issues/8535)

## [15.0.1](https://github.com/puppeteer/puppeteer/compare/v15.0.0...v15.0.1) (2022-06-24)

### Bug Fixes

- infer unioned handles ([#8562](https://github.com/puppeteer/puppeteer/issues/8562)) ([8100cbb](https://github.com/puppeteer/puppeteer/commit/8100cbb29569541541f61001983efb9a80d89890))

## [15.0.0](https://github.com/puppeteer/puppeteer/compare/v14.4.1...v15.0.0) (2022-06-23)

### ⚠ BREAKING CHANGES

- type inference for evaluation types (#8547)

### Features

- add experimental `client` to `HTTPRequest` ([#8556](https://github.com/puppeteer/puppeteer/issues/8556)) ([ec79f3a](https://github.com/puppeteer/puppeteer/commit/ec79f3a58a44c9ea60a82f9cd2df4c8f19e82ab8))
- type inference for evaluation types ([#8547](https://github.com/puppeteer/puppeteer/issues/8547)) ([26c3acb](https://github.com/puppeteer/puppeteer/commit/26c3acbb0795eb66f29479f442e156832f794f01))

## [14.4.1](https://github.com/puppeteer/puppeteer/compare/v14.4.0...v14.4.1) (2022-06-17)

### Bug Fixes

- avoid `instanceof Object` check in `isErrorLike` ([#8527](https://github.com/puppeteer/puppeteer/issues/8527)) ([6cd5cd0](https://github.com/puppeteer/puppeteer/commit/6cd5cd043997699edca6e3458f90adc1118cf4a5))
- export `devices`, `errors`, and more ([cba58a1](https://github.com/puppeteer/puppeteer/commit/cba58a12c4e2043f6a5acf7d4754e4a7b7f6e198))

## [14.4.0](https://github.com/puppeteer/puppeteer/compare/v14.3.0...v14.4.0) (2022-06-13)

### Features

- export puppeteer methods ([#8493](https://github.com/puppeteer/puppeteer/issues/8493)) ([465a7c4](https://github.com/puppeteer/puppeteer/commit/465a7c405f01fcef99380ffa69d86042a1f5618f))
- support node-like environments ([#8490](https://github.com/puppeteer/puppeteer/issues/8490)) ([f64ec20](https://github.com/puppeteer/puppeteer/commit/f64ec2051b9b2d12225abba6ffe9551da9751bf7))

### Bug Fixes

- parse empty options in \<select\> ([#8489](https://github.com/puppeteer/puppeteer/issues/8489)) ([b30f3f4](https://github.com/puppeteer/puppeteer/commit/b30f3f44cdabd9545c4661cd755b9d49e5c144cd))
- use error-like ([#8504](https://github.com/puppeteer/puppeteer/issues/8504)) ([4d35990](https://github.com/puppeteer/puppeteer/commit/4d359906a44e4ddd5ec54a523cfd9076048d3433))
- use OS-independent abs. path check ([#8505](https://github.com/puppeteer/puppeteer/issues/8505)) ([bfd4e68](https://github.com/puppeteer/puppeteer/commit/bfd4e68f25bec6e00fd5cbf261813f8297d362ee))

## [14.3.0](https://github.com/puppeteer/puppeteer/compare/v14.2.1...v14.3.0) (2022-06-07)

### Features

- use absolute URL for EVALUATION_SCRIPT_URL ([#8481](https://github.com/puppeteer/puppeteer/issues/8481)) ([e142560](https://github.com/puppeteer/puppeteer/commit/e14256010d2d84d613cd3c6e7999b0705115d4bf)), closes [#8424](https://github.com/puppeteer/puppeteer/issues/8424)

### Bug Fixes

- don't throw on bad access ([#8472](https://github.com/puppeteer/puppeteer/issues/8472)) ([e837866](https://github.com/puppeteer/puppeteer/commit/e8378666c671e5703aec4f52912de2aac94e1828))
- Kill browser process when killing process group fails ([#8477](https://github.com/puppeteer/puppeteer/issues/8477)) ([7dc8e37](https://github.com/puppeteer/puppeteer/commit/7dc8e37a23d025bb2c31efb9c060c7f6e00179b4))
- only lookup `localhost` for DNS lookups ([1b025b4](https://github.com/puppeteer/puppeteer/commit/1b025b4c8466fe64da0fa2050eaa02b7764770b1))
- robustly check for launch executable ([#8468](https://github.com/puppeteer/puppeteer/issues/8468)) ([b54dc55](https://github.com/puppeteer/puppeteer/commit/b54dc55f7622ee2b75afd3bd9fe118dd2f144f40))

## [14.2.1](https://github.com/puppeteer/puppeteer/compare/v14.2.0...v14.2.1) (2022-06-02)

### Bug Fixes

- use isPageTargetCallback in Browser::pages() ([#8460](https://github.com/puppeteer/puppeteer/issues/8460)) ([5c9050a](https://github.com/puppeteer/puppeteer/commit/5c9050aea0fe8d57114130fe38bd33ed2b4955d6))

## [14.2.0](https://github.com/puppeteer/puppeteer/compare/v14.1.2...v14.2.0) (2022-06-01)

### Features

- **chromium:** roll to Chromium 103.0.5059.0 (r1002410) ([#8410](https://github.com/puppeteer/puppeteer/issues/8410)) ([54efc2c](https://github.com/puppeteer/puppeteer/commit/54efc2c949be1d6ef22f4d2630620e33d14d2597))
- support node 18 ([#8447](https://github.com/puppeteer/puppeteer/issues/8447)) ([f2d8276](https://github.com/puppeteer/puppeteer/commit/f2d8276d6e745a7547b8ce54c3f50934bb70de0b))
- use strict typescript ([#8401](https://github.com/puppeteer/puppeteer/issues/8401)) ([b4e751f](https://github.com/puppeteer/puppeteer/commit/b4e751f29cb6fd4c3cc41fe702de83721f0eb6dc))

### Bug Fixes

- multiple same request event listener ([#8404](https://github.com/puppeteer/puppeteer/issues/8404)) ([9211015](https://github.com/puppeteer/puppeteer/commit/92110151d9a33f26abc07bc805f4f2f3943697a0))
- NodeNext incompatibility in package.json ([#8445](https://github.com/puppeteer/puppeteer/issues/8445)) ([c4898a7](https://github.com/puppeteer/puppeteer/commit/c4898a7a2e69681baac55366848da6688f0d8790))
- process documentation during publishing ([#8433](https://github.com/puppeteer/puppeteer/issues/8433)) ([d111d19](https://github.com/puppeteer/puppeteer/commit/d111d19f788d88d984dcf4ad7542f59acd2f4c1e))

## [14.1.2](https://github.com/puppeteer/puppeteer/compare/v14.1.1...v14.1.2) (2022-05-30)

### Bug Fixes

- do not use loaderId for lifecycle events ([#8395](https://github.com/puppeteer/puppeteer/issues/8395)) ([c96c915](https://github.com/puppeteer/puppeteer/commit/c96c915b535dcf414038677bd3d3ed6b980a4901))
- fix release-please bot ([#8400](https://github.com/puppeteer/puppeteer/issues/8400)) ([5c235c7](https://github.com/puppeteer/puppeteer/commit/5c235c701fc55380f09d09ac2cf63f2c94b60e3d))
- use strict TS in Input.ts ([#8392](https://github.com/puppeteer/puppeteer/issues/8392)) ([af92a24](https://github.com/puppeteer/puppeteer/commit/af92a24ba9fc8efea1ba41f96d87515cf760da65))

## [14.1.1](https://github.com/puppeteer/puppeteer/compare/v14.1.0...v14.1.1) (2022-05-19)

### Bug Fixes

- kill browser process when 'taskkill' fails on Windows ([#8352](https://github.com/puppeteer/puppeteer/issues/8352)) ([dccfadb](https://github.com/puppeteer/puppeteer/commit/dccfadb90e8947cae3f33d7a209b6f5752f97b46))
- only check loading iframe in lifecycling ([#8348](https://github.com/puppeteer/puppeteer/issues/8348)) ([7438030](https://github.com/puppeteer/puppeteer/commit/74380303ac6cc6e2d84948a10920d56e665ccebe))
- recompile before funit and unit commands ([#8363](https://github.com/puppeteer/puppeteer/issues/8363)) ([8735b78](https://github.com/puppeteer/puppeteer/commit/8735b784ba7838c1002b521a7f9f23bb27263d03)), closes [#8362](https://github.com/puppeteer/puppeteer/issues/8362)

## [14.1.0](https://github.com/puppeteer/puppeteer/compare/v14.0.0...v14.1.0) (2022-05-13)

### Features

- add waitForXPath to ElementHandle ([#8329](https://github.com/puppeteer/puppeteer/issues/8329)) ([7eaadaf](https://github.com/puppeteer/puppeteer/commit/7eaadafe197279a7d1753e7274d2e24dfc11abdf))
- allow handling other targets as pages internally ([#8336](https://github.com/puppeteer/puppeteer/issues/8336)) ([3b66a2c](https://github.com/puppeteer/puppeteer/commit/3b66a2c47ee36785a6a72c9afedd768fab3d040a))

### Bug Fixes

- disable AvoidUnnecessaryBeforeUnloadCheckSync to fix navigations ([#8330](https://github.com/puppeteer/puppeteer/issues/8330)) ([4854ad5](https://github.com/puppeteer/puppeteer/commit/4854ad5b15c9bdf93c06dcb758393e7cbacd7469))
- If currentNode and root are the same, do not include them in the result ([#8332](https://github.com/puppeteer/puppeteer/issues/8332)) ([a61144d](https://github.com/puppeteer/puppeteer/commit/a61144d43780b5c32197427d7682b9b6c433f2bb))

## [14.0.0](https://github.com/puppeteer/puppeteer/compare/v13.7.0...v14.0.0) (2022-05-09)

### ⚠ BREAKING CHANGES

- strict mode fixes for HTTPRequest/Response classes (#8297)
- Node 12 is no longer supported.

### Features

- add support for Apple Silicon chromium builds ([#7546](https://github.com/puppeteer/puppeteer/issues/7546)) ([baa017d](https://github.com/puppeteer/puppeteer/commit/baa017db92b1fecf2e3584d5b3161371ae60f55b)), closes [#6622](https://github.com/puppeteer/puppeteer/issues/6622)
- **chromium:** roll to Chromium 102.0.5002.0 (r991974) ([#8319](https://github.com/puppeteer/puppeteer/issues/8319)) ([be4c930](https://github.com/puppeteer/puppeteer/commit/be4c930c60164f681a966d0f8cb745f6c263fe2b))
- support ES modules ([#8306](https://github.com/puppeteer/puppeteer/issues/8306)) ([6841bd6](https://github.com/puppeteer/puppeteer/commit/6841bd68d85e3b3952c5e7ce454ac4d23f84262d))

### Bug Fixes

- apparent typo SUPPORTER_PLATFORMS ([#8294](https://github.com/puppeteer/puppeteer/issues/8294)) ([e09287f](https://github.com/puppeteer/puppeteer/commit/e09287f4e9a1ff3c637dd165d65f221394970e2c))
- make sure inner OOPIFs can be attached to ([#8304](https://github.com/puppeteer/puppeteer/issues/8304)) ([5539598](https://github.com/puppeteer/puppeteer/commit/553959884f4edb4deab760fa8ca38fc1c85c05c5))
- strict mode fixes for HTTPRequest/Response classes ([#8297](https://github.com/puppeteer/puppeteer/issues/8297)) ([2804ae8](https://github.com/puppeteer/puppeteer/commit/2804ae8cdbc4c90bf942510bce656275a2d409e1)), closes [#6769](https://github.com/puppeteer/puppeteer/issues/6769)
- tests failing in headful ([#8273](https://github.com/puppeteer/puppeteer/issues/8273)) ([e841d7f](https://github.com/puppeteer/puppeteer/commit/e841d7f9f3f407c02dbc48e107b545b91db104e6))
- drop Node 12 support ([#8299](https://github.com/puppeteer/puppeteer/issues/8299)) ([274bd6b](https://github.com/puppeteer/puppeteer/commit/274bd6b3b98c305ed014909d8053e4c54187971b))

## [13.7.0](https://github.com/puppeteer/puppeteer/compare/v13.6.0...v13.7.0) (2022-04-28)

### Features

- add `back` and `forward` mouse buttons ([#8284](https://github.com/puppeteer/puppeteer/issues/8284)) ([7a51bff](https://github.com/puppeteer/puppeteer/commit/7a51bff47f6436fc29d0df7eb74f12f69102ca5b))
- support chrome headless mode ([#8260](https://github.com/puppeteer/puppeteer/issues/8260)) ([1308d9a](https://github.com/puppeteer/puppeteer/commit/1308d9aa6a5920b20da02dca8db03c63e43c8b84))

### Bug Fixes

- doc typo ([#8263](https://github.com/puppeteer/puppeteer/issues/8263)) ([952a2ae](https://github.com/puppeteer/puppeteer/commit/952a2ae0bc4f059f8e8b4d1de809d0a486a74551))
- use different test names for browser specific tests in launcher.spec.ts ([#8250](https://github.com/puppeteer/puppeteer/issues/8250)) ([c6cf1a9](https://github.com/puppeteer/puppeteer/commit/c6cf1a9f27621c8a619cfbdc9d0821541768ac94))

## [13.6.0](https://github.com/puppeteer/puppeteer/compare/v13.5.2...v13.6.0) (2022-04-19)

### Features

- **chromium:** roll to Chromium 101.0.4950.0 (r982053) ([#8213](https://github.com/puppeteer/puppeteer/issues/8213)) ([ec74bd8](https://github.com/puppeteer/puppeteer/commit/ec74bd811d9b7fbaf600068e86f13a63d7b0bc6f))
- respond multiple headers with same key ([#8183](https://github.com/puppeteer/puppeteer/issues/8183)) ([c1dcd85](https://github.com/puppeteer/puppeteer/commit/c1dcd857e3bc17769f02474a41bbedee01f471dc))

### Bug Fixes

- also kill Firefox when temporary profile is used ([#8233](https://github.com/puppeteer/puppeteer/issues/8233)) ([b6504d7](https://github.com/puppeteer/puppeteer/commit/b6504d7186336a2fc0b41c3878c843b7409ba5fb))
- consider existing frames when waiting for a frame ([#8200](https://github.com/puppeteer/puppeteer/issues/8200)) ([0955225](https://github.com/puppeteer/puppeteer/commit/0955225b51421663288523a3dfb63103b51775b4))
- disable bfcache in the launcher ([#8196](https://github.com/puppeteer/puppeteer/issues/8196)) ([9ac7318](https://github.com/puppeteer/puppeteer/commit/9ac7318506ac858b3465e9b4ede8ad75fbbcee11)), closes [#8182](https://github.com/puppeteer/puppeteer/issues/8182)
- enable page.spec event handler test for firefox ([#8214](https://github.com/puppeteer/puppeteer/issues/8214)) ([2b45027](https://github.com/puppeteer/puppeteer/commit/2b45027d256f85f21a0c824183696b237e00ad33))
- forget queuedEventGroup when emitting response in responseReceivedExtraInfo ([#8234](https://github.com/puppeteer/puppeteer/issues/8234)) ([#8239](https://github.com/puppeteer/puppeteer/issues/8239)) ([91a8e73](https://github.com/puppeteer/puppeteer/commit/91a8e73b1196e4128b1e7c25e08080f2faaf3cf7))
- forget request will be sent from the \_requestWillBeSentMap list. ([#8226](https://github.com/puppeteer/puppeteer/issues/8226)) ([4b786c9](https://github.com/puppeteer/puppeteer/commit/4b786c904cbfe3f059322292f3b788b8a5ebd9bf))
- ignore favicon requests in page.spec event handler tests ([#8208](https://github.com/puppeteer/puppeteer/issues/8208)) ([04e5c88](https://github.com/puppeteer/puppeteer/commit/04e5c889973432c6163a8539cdec23c0e8726bff))
- **network.spec.ts:** typo in the word should ([#8223](https://github.com/puppeteer/puppeteer/issues/8223)) ([e93faad](https://github.com/puppeteer/puppeteer/commit/e93faadc21b7fcb1e03b69c451c28b769f9cde51))

## [13.5.2](https://github.com/puppeteer/puppeteer/compare/v13.5.1...v13.5.2) (2022-03-31)

### Bug Fixes

- chromium downloading hung at 99% ([#8169](https://github.com/puppeteer/puppeteer/issues/8169)) ([8f13470](https://github.com/puppeteer/puppeteer/commit/8f13470af06045857f32496f03e77b14f3ecff98))
- get extra headers from Fetch.requestPaused event ([#8162](https://github.com/puppeteer/puppeteer/issues/8162)) ([37ede68](https://github.com/puppeteer/puppeteer/commit/37ede6877017a8dc6c946a3dff4ec6d79c3ebc59))

## [13.5.1](https://github.com/puppeteer/puppeteer/compare/v13.5.0...v13.5.1) (2022-03-09)

### Bug Fixes

- waitForNavigation in OOPIFs ([#8117](https://github.com/puppeteer/puppeteer/issues/8117)) ([34775e5](https://github.com/puppeteer/puppeteer/commit/34775e58316be49d8bc5a13209a1f570bc66b448))

## [13.5.0](https://github.com/puppeteer/puppeteer/compare/v13.4.1...v13.5.0) (2022-03-07)

### Features

- **chromium:** roll to Chromium 100.0.4889.0 (r970485) ([#8108](https://github.com/puppeteer/puppeteer/issues/8108)) ([d12f427](https://github.com/puppeteer/puppeteer/commit/d12f42754f7013b5ec0a2198cf2d9cf945d3cb38))

### Bug Fixes

- Inherit browser-level proxy settings from incognito context ([#7770](https://github.com/puppeteer/puppeteer/issues/7770)) ([3feca32](https://github.com/puppeteer/puppeteer/commit/3feca325a9472ee36f7e866ebe375c7f083e0e36))
- **page:** page.createIsolatedWorld error catching has been added ([#7848](https://github.com/puppeteer/puppeteer/issues/7848)) ([309e8b8](https://github.com/puppeteer/puppeteer/commit/309e8b80da0519327bc37b44a3ebb6f2e2d357a7))
- **tests:** ensure all tests honour BINARY envvar ([#8092](https://github.com/puppeteer/puppeteer/issues/8092)) ([3b8b9ad](https://github.com/puppeteer/puppeteer/commit/3b8b9adde5d18892af96329b6f9303979f9c04f5))

## [13.4.1](https://github.com/puppeteer/puppeteer/compare/v13.4.0...v13.4.1) (2022-03-01)

### Bug Fixes

- regression in --user-data-dir handling ([#8060](https://github.com/puppeteer/puppeteer/issues/8060)) ([85decdc](https://github.com/puppeteer/puppeteer/commit/85decdc28d7d2128e6d2946a72f4d99dd5dbb48a))

## [13.4.0](https://github.com/puppeteer/puppeteer/compare/v13.3.2...v13.4.0) (2022-02-22)

### Features

- add support for async waitForTarget ([#7885](https://github.com/puppeteer/puppeteer/issues/7885)) ([dbf0639](https://github.com/puppeteer/puppeteer/commit/dbf0639822d0b2736993de52c0bfe1dbf4e58f25))
- export `Frame._client` through getter ([#8041](https://github.com/puppeteer/puppeteer/issues/8041)) ([e9278fc](https://github.com/puppeteer/puppeteer/commit/e9278fcfcffe2558de63ce7542483445bcb6e74f))
- **HTTPResponse:** expose timing information ([#8025](https://github.com/puppeteer/puppeteer/issues/8025)) ([30b3d49](https://github.com/puppeteer/puppeteer/commit/30b3d49b0de46d812b7485e708174a07c73dbdd0))

### Bug Fixes

- change kill to signal the whole process group to terminate ([#6859](https://github.com/puppeteer/puppeteer/issues/6859)) ([0eb9c78](https://github.com/puppeteer/puppeteer/commit/0eb9c7861717ebba7012c03e76b7a46063e4e5dd))
- element screenshot issue in headful mode ([#8018](https://github.com/puppeteer/puppeteer/issues/8018)) ([5346e70](https://github.com/puppeteer/puppeteer/commit/5346e70ffc15b33c1949657cf1b465f1acc5d84d)), closes [#7999](https://github.com/puppeteer/puppeteer/issues/7999)
- ensure dom binding is not called after detach ([#8024](https://github.com/puppeteer/puppeteer/issues/8024)) ([5c308b0](https://github.com/puppeteer/puppeteer/commit/5c308b0704123736ddb085f97596c201ea18cf4a)), closes [#7814](https://github.com/puppeteer/puppeteer/issues/7814)
- use both \_\_dirname and require.resolve to support different bundlers ([#8046](https://github.com/puppeteer/puppeteer/issues/8046)) ([e6a6295](https://github.com/puppeteer/puppeteer/commit/e6a6295d9a7480bb59ee58a2cc7785171fa0fa2c)), closes [#8044](https://github.com/puppeteer/puppeteer/issues/8044)

## [13.3.2](https://github.com/puppeteer/puppeteer/compare/v13.3.1...v13.3.2) (2022-02-14)

### Bug Fixes

- always use ENV executable path when present ([#7985](https://github.com/puppeteer/puppeteer/issues/7985)) ([6d6ea9b](https://github.com/puppeteer/puppeteer/commit/6d6ea9bf59daa3fb851b3da8baa27887e0aa2c28))
- use require.resolve instead of \_\_dirname ([#8003](https://github.com/puppeteer/puppeteer/issues/8003)) ([bbb186d](https://github.com/puppeteer/puppeteer/commit/bbb186d88cb99e4914299c983c822fa41a80f356))

## [13.3.1](https://github.com/puppeteer/puppeteer/compare/v13.3.0...v13.3.1) (2022-02-10)

### Bug Fixes

- **puppeteer:** revert: esm modules ([#7986](https://github.com/puppeteer/puppeteer/issues/7986)) ([179eded](https://github.com/puppeteer/puppeteer/commit/179ededa1400c35c1f2edc015548e0f2a1bcee14))

## [13.3.0](https://github.com/puppeteer/puppeteer/compare/v13.2.0...v13.3.0) (2022-02-09)

### Features

- **puppeteer:** export esm modules in package.json ([#7964](https://github.com/puppeteer/puppeteer/issues/7964)) ([523b487](https://github.com/puppeteer/puppeteer/commit/523b487e8802824cecff86d256b4f7dbc4c47c8a))

## [13.2.0](https://github.com/puppeteer/puppeteer/compare/v13.1.3...v13.2.0) (2022-02-07)

### Features

- add more models to DeviceDescriptors ([#7904](https://github.com/puppeteer/puppeteer/issues/7904)) ([6a655cb](https://github.com/puppeteer/puppeteer/commit/6a655cb647e12eaf1055be0b298908d83bebac25))
- **chromium:** roll to Chromium 99.0.4844.16 (r961656) ([#7960](https://github.com/puppeteer/puppeteer/issues/7960)) ([96c3f94](https://github.com/puppeteer/puppeteer/commit/96c3f943b2f6e26bd871ecfcce71b6a33e214ebf))

### Bug Fixes

- make projectRoot optional in Puppeteer and launchers ([#7967](https://github.com/puppeteer/puppeteer/issues/7967)) ([9afdc63](https://github.com/puppeteer/puppeteer/commit/9afdc6300b80f01091dc4cb42d4ebe952c7d60f0))
- migrate more files to strict-mode TypeScript ([#7950](https://github.com/puppeteer/puppeteer/issues/7950)) ([aaac8d9](https://github.com/puppeteer/puppeteer/commit/aaac8d9c44327a2c503ffd6c97b7f21e8010c3e4))
- typos in documentation ([#7968](https://github.com/puppeteer/puppeteer/issues/7968)) ([41ab4e9](https://github.com/puppeteer/puppeteer/commit/41ab4e9127df64baa6c43ecde2f7ddd702ba7b0c))

## [13.1.3](https://github.com/puppeteer/puppeteer/compare/v13.1.2...v13.1.3) (2022-01-31)

### Bug Fixes

- issue with reading versions.js in doclint ([#7940](https://github.com/puppeteer/puppeteer/issues/7940)) ([06ba963](https://github.com/puppeteer/puppeteer/commit/06ba9632a4c63859244068d32c312817d90daf63))
- make more files work in strict-mode TypeScript ([#7936](https://github.com/puppeteer/puppeteer/issues/7936)) ([0636513](https://github.com/puppeteer/puppeteer/commit/0636513e34046f4d40b5e88beb2b18b16dab80aa))
- page.pdf producing an invalid pdf ([#7868](https://github.com/puppeteer/puppeteer/issues/7868)) ([afea509](https://github.com/puppeteer/puppeteer/commit/afea509544fb99bfffe5b0bebe6f3575c53802f0)), closes [#7757](https://github.com/puppeteer/puppeteer/issues/7757)

## [13.1.2](https://github.com/puppeteer/puppeteer/compare/v13.1.1...v13.1.2) (2022-01-25)

### Bug Fixes

- **package.json:** update node-fetch package ([#7924](https://github.com/puppeteer/puppeteer/issues/7924)) ([e4c48d3](https://github.com/puppeteer/puppeteer/commit/e4c48d3b8c2a812752094ed8163e4f2f32c4b6cb))
- types in Browser.ts to be compatible with strict mode Typescript ([#7918](https://github.com/puppeteer/puppeteer/issues/7918)) ([a8ec0aa](https://github.com/puppeteer/puppeteer/commit/a8ec0aadc9c90d224d568d9e418d14261e6e85b1)), closes [#6769](https://github.com/puppeteer/puppeteer/issues/6769)
- types in Connection.ts to be compatible with strict mode Typescript ([#7919](https://github.com/puppeteer/puppeteer/issues/7919)) ([d80d602](https://github.com/puppeteer/puppeteer/commit/d80d6027ea8e1b7fcdaf045398629cf8e6512658)), closes [#6769](https://github.com/puppeteer/puppeteer/issues/6769)

## [13.1.1](https://github.com/puppeteer/puppeteer/compare/v13.1.0...v13.1.1) (2022-01-18)

### Bug Fixes

- use content box for OOPIF offset calculations ([#7911](https://github.com/puppeteer/puppeteer/issues/7911)) ([344feb5](https://github.com/puppeteer/puppeteer/commit/344feb53c28ce018a4c600d408468f6d9d741eee))

## [13.1.0](https://github.com/puppeteer/puppeteer/compare/v13.0.1...v13.1.0) (2022-01-17)

### Features

- **chromium:** roll to Chromium 98.0.4758.0 (r950341) ([#7907](https://github.com/puppeteer/puppeteer/issues/7907)) ([a55c86f](https://github.com/puppeteer/puppeteer/commit/a55c86fac504b5e89ba23735fb3a1b1d54a4e1e5))

### Bug Fixes

- apply OOPIF offsets to bounding box and box model calls ([#7906](https://github.com/puppeteer/puppeteer/issues/7906)) ([a566263](https://github.com/puppeteer/puppeteer/commit/a566263ba28e58ff648bffbdb628606f75d5876f))
- correctly compute clickable points for elements inside OOPIFs ([#7900](https://github.com/puppeteer/puppeteer/issues/7900)) ([486bbe0](https://github.com/puppeteer/puppeteer/commit/486bbe010d5ee5c446d9e8daf61a080232379c3f)), closes [#7849](https://github.com/puppeteer/puppeteer/issues/7849)
- error for pre-existing OOPIFs ([#7899](https://github.com/puppeteer/puppeteer/issues/7899)) ([d7937b8](https://github.com/puppeteer/puppeteer/commit/d7937b806d331bf16c2016aaf16e932b1334eac8)), closes [#7844](https://github.com/puppeteer/puppeteer/issues/7844) [#7896](https://github.com/puppeteer/puppeteer/issues/7896)

## [13.0.1](https://github.com/puppeteer/puppeteer/compare/v13.0.0...v13.0.1) (2021-12-22)

### Bug Fixes

- disable a test failing on Firefox ([#7846](https://github.com/puppeteer/puppeteer/issues/7846)) ([36207c5](https://github.com/puppeteer/puppeteer/commit/36207c5efe8ca21f4b3fc5b00212700326a701d2))
- make sure ElementHandle.waitForSelector is evaluated in the right context ([#7843](https://github.com/puppeteer/puppeteer/issues/7843)) ([8d8e874](https://github.com/puppeteer/puppeteer/commit/8d8e874b072b17fc763f33d08e51c046b7435244))
- predicate arguments for waitForFunction ([#7845](https://github.com/puppeteer/puppeteer/issues/7845)) ([1c44551](https://github.com/puppeteer/puppeteer/commit/1c44551f1b5bb19455b4a1eb7061715717ec880e)), closes [#7836](https://github.com/puppeteer/puppeteer/issues/7836)

## [13.0.0](https://github.com/puppeteer/puppeteer/compare/v12.0.1...v13.0.0) (2021-12-10)

### ⚠ BREAKING CHANGES

- typo in 'already-handled' constant of the request interception API (#7813)

### Features

- expose HTTPRequest intercept resolution state and clarify docs ([#7796](https://github.com/puppeteer/puppeteer/issues/7796)) ([dc23b75](https://github.com/puppeteer/puppeteer/commit/dc23b7535cb958c00d1eecfe85b4ee26e52e2e39))
- implement Element.waitForSelector ([#7825](https://github.com/puppeteer/puppeteer/issues/7825)) ([c034294](https://github.com/puppeteer/puppeteer/commit/c03429444d05b39549489ad3da67d93b2be59f51))

### Bug Fixes

- handle multiple/duplicate Fetch.requestPaused events ([#7802](https://github.com/puppeteer/puppeteer/issues/7802)) ([636b086](https://github.com/puppeteer/puppeteer/commit/636b0863a169da132e333eb53b17eb2601daabe6)), closes [#7475](https://github.com/puppeteer/puppeteer/issues/7475) [#6696](https://github.com/puppeteer/puppeteer/issues/6696) [#7225](https://github.com/puppeteer/puppeteer/issues/7225)
- revert "feat(typescript): allow using puppeteer without dom lib" ([02c9af6](https://github.com/puppeteer/puppeteer/commit/02c9af62d64060a83f53368640f343ae2e30e38a)), closes [#6998](https://github.com/puppeteer/puppeteer/issues/6998)
- typo in 'already-handled' constant of the request interception API ([#7813](https://github.com/puppeteer/puppeteer/issues/7813)) ([8242422](https://github.com/puppeteer/puppeteer/commit/824242246de9e158aacb85f71350a79cb386ed92)), closes [#7745](https://github.com/puppeteer/puppeteer/issues/7745) [#7747](https://github.com/puppeteer/puppeteer/issues/7747) [#7780](https://github.com/puppeteer/puppeteer/issues/7780)

## [12.0.1](https://github.com/puppeteer/puppeteer/compare/v12.0.0...v12.0.1) (2021-11-29)

### Bug Fixes

- handle extraInfo events even if event.hasExtraInfo === false ([#7808](https://github.com/puppeteer/puppeteer/issues/7808)) ([6ee2feb](https://github.com/puppeteer/puppeteer/commit/6ee2feb1eafdd399f0af50cdc4517f21bcb55121)), closes [#7805](https://github.com/puppeteer/puppeteer/issues/7805)

## [12.0.0](https://github.com/puppeteer/puppeteer/compare/v11.0.0...v12.0.0) (2021-11-26)

### ⚠ BREAKING CHANGES

- **chromium:** roll to Chromium 97.0.4692.0 (r938248)

### Features

- **chromium:** roll to Chromium 97.0.4692.0 (r938248) ([ac162c5](https://github.com/puppeteer/puppeteer/commit/ac162c561ee43dd69eff38e1b354a41bb42c9eba)), closes [#7458](https://github.com/puppeteer/puppeteer/issues/7458)
- support for custom user data (profile) directory for Firefox ([#7684](https://github.com/puppeteer/puppeteer/issues/7684)) ([790c7a0](https://github.com/puppeteer/puppeteer/commit/790c7a0eb92291efebaa37e80c72f5cb5f46bbdb))

### Bug Fixes

- **ariaqueryhandler:** allow single quotes in aria attribute selector ([#7750](https://github.com/puppeteer/puppeteer/issues/7750)) ([b0319ec](https://github.com/puppeteer/puppeteer/commit/b0319ecc89f8ea3d31ab9aee5e1cd33d2a4e62be)), closes [#7721](https://github.com/puppeteer/puppeteer/issues/7721)
- clearer jsdoc for behavior of `headless` when `devtools` is true ([#7748](https://github.com/puppeteer/puppeteer/issues/7748)) ([9f9b4ed](https://github.com/puppeteer/puppeteer/commit/9f9b4ed72ab0bb43d002a0024122d6f5eab231aa))
- null check for frame in FrameManager ([#7773](https://github.com/puppeteer/puppeteer/issues/7773)) ([23ee295](https://github.com/puppeteer/puppeteer/commit/23ee295f348d114617f2a86d0bb792936f413ac5)), closes [#7749](https://github.com/puppeteer/puppeteer/issues/7749)
- only kill the process when there is no browser instance available ([#7762](https://github.com/puppeteer/puppeteer/issues/7762)) ([51e6169](https://github.com/puppeteer/puppeteer/commit/51e61696c1c20cc09bd4fc068ae1dfa259c41745)), closes [#7668](https://github.com/puppeteer/puppeteer/issues/7668)
- parse statusText from the extraInfo event ([#7798](https://github.com/puppeteer/puppeteer/issues/7798)) ([a26b12b](https://github.com/puppeteer/puppeteer/commit/a26b12b7c775c36271cd4c98e39bbd59f4356320)), closes [#7458](https://github.com/puppeteer/puppeteer/issues/7458)
- try to remove the temporary user data directory after the process has been killed ([#7761](https://github.com/puppeteer/puppeteer/issues/7761)) ([fc94a28](https://github.com/puppeteer/puppeteer/commit/fc94a28778cfdb3cb8bcd882af3ebcdacf85c94e))

## [11.0.0](https://github.com/puppeteer/puppeteer/compare/v10.4.0...v11.0.0) (2021-11-02)

### ⚠ BREAKING CHANGES

- **oop iframes:** integrate OOP iframes with the frame manager (#7556)

### Features

- improve error message for response.buffer() ([#7669](https://github.com/puppeteer/puppeteer/issues/7669)) ([03c9ecc](https://github.com/puppeteer/puppeteer/commit/03c9ecca400a02684cd60229550dbad1190a5b6e))
- **oop iframes:** integrate OOP iframes with the frame manager ([#7556](https://github.com/puppeteer/puppeteer/issues/7556)) ([4d9dc8c](https://github.com/puppeteer/puppeteer/commit/4d9dc8c0e613f22d4cdf237e8bd0b0da3c588edb)), closes [#2548](https://github.com/puppeteer/puppeteer/issues/2548)
- add custom debugging port option ([#4993](https://github.com/puppeteer/puppeteer/issues/4993)) ([26145e9](https://github.com/puppeteer/puppeteer/commit/26145e9a24af7caed6ece61031f2cafa6abd505f))
- add initiator to HTTPRequest ([#7614](https://github.com/puppeteer/puppeteer/issues/7614)) ([a271145](https://github.com/puppeteer/puppeteer/commit/a271145b0663ef9de1903dd0eb9fd5366465bed7))
- allow to customize tmpdir ([#7243](https://github.com/puppeteer/puppeteer/issues/7243)) ([b1f6e86](https://github.com/puppeteer/puppeteer/commit/b1f6e8692b0bc7e8551b2a78169c830cd80a7acb))
- handle unhandled promise rejections in tests ([#7722](https://github.com/puppeteer/puppeteer/issues/7722)) ([07febca](https://github.com/puppeteer/puppeteer/commit/07febca04b391893cfc872250e4391da142d4fe2))

### Bug Fixes

- add support for relative install paths to BrowserFetcher ([#7613](https://github.com/puppeteer/puppeteer/issues/7613)) ([eebf452](https://github.com/puppeteer/puppeteer/commit/eebf452d38b79bb2ea1a1ba84c3d2ea6f2f9f899)), closes [#7592](https://github.com/puppeteer/puppeteer/issues/7592)
- add webp to screenshot quality option allow list ([#7631](https://github.com/puppeteer/puppeteer/issues/7631)) ([b20c2bf](https://github.com/puppeteer/puppeteer/commit/b20c2bfa24cbdd4a1b9cefca2e0a9407e442baf5))
- prevent Target closed errors on streams ([#7728](https://github.com/puppeteer/puppeteer/issues/7728)) ([5b792de](https://github.com/puppeteer/puppeteer/commit/5b792de7a97611441777d1ac99cb95516301d7dc))
- request an animation frame to fix flaky clickablePoint test ([#7587](https://github.com/puppeteer/puppeteer/issues/7587)) ([7341d9f](https://github.com/puppeteer/puppeteer/commit/7341d9fadd1466a5b2f2bde8631f3b02cf9a7d8a))
- setup husky properly ([#7727](https://github.com/puppeteer/puppeteer/issues/7727)) ([8b712e7](https://github.com/puppeteer/puppeteer/commit/8b712e7b642b58193437f26d4e104a9e412f388d)), closes [#7726](https://github.com/puppeteer/puppeteer/issues/7726)
- updated troubleshooting.md to meet latest dependencies changes ([#7656](https://github.com/puppeteer/puppeteer/issues/7656)) ([edb0197](https://github.com/puppeteer/puppeteer/commit/edb01972b9606d8b05b979a588eda0d622315981))
- **launcher:** launcher.launch() should pass 'timeout' option [#5180](https://github.com/puppeteer/puppeteer/issues/5180) ([#7596](https://github.com/puppeteer/puppeteer/issues/7596)) ([113489d](https://github.com/puppeteer/puppeteer/commit/113489d3b58e2907374a4e6e5133bf46630695d1))
- **page:** fallback to default in exposeFunction when using imported module ([#6365](https://github.com/puppeteer/puppeteer/issues/6365)) ([44c9ec6](https://github.com/puppeteer/puppeteer/commit/44c9ec67c57dccf3e186c86f14f3a8da9a8eb971))
- **page:** fix page.off method for request event ([#7624](https://github.com/puppeteer/puppeteer/issues/7624)) ([d0cb943](https://github.com/puppeteer/puppeteer/commit/d0cb9436a302418086f6763e0e58ae3732a20b62)), closes [#7572](https://github.com/puppeteer/puppeteer/issues/7572)

## [10.4.0](https://github.com/puppeteer/puppeteer/compare/v10.2.0...v10.4.0) (2021-09-21)

### Features

- add webp to screenshot options ([#7565](https://github.com/puppeteer/puppeteer/issues/7565)) ([43a9268](https://github.com/puppeteer/puppeteer/commit/43a926832505a57922016907a264165676424557))
- **page:** expose page.client() ([#7582](https://github.com/puppeteer/puppeteer/issues/7582)) ([99ca842](https://github.com/puppeteer/puppeteer/commit/99ca842124a1edef5e66426621885141a9feaca5))
- **page:** mark page.client() as internal ([#7585](https://github.com/puppeteer/puppeteer/issues/7585)) ([8451951](https://github.com/puppeteer/puppeteer/commit/84519514831f304f9076ca235fe474f797616b2c))
- add ability to specify offsets for JSHandle.click ([#7573](https://github.com/puppeteer/puppeteer/issues/7573)) ([2b5c001](https://github.com/puppeteer/puppeteer/commit/2b5c0019dc3744196c5858edeaa901dff9973ef5))
- add durableStorage to allowed permissions ([#5295](https://github.com/puppeteer/puppeteer/issues/5295)) ([eda5171](https://github.com/puppeteer/puppeteer/commit/eda51712790b9260626dc53cfb58a72805c45582))
- add id option to addScriptTag ([#5477](https://github.com/puppeteer/puppeteer/issues/5477)) ([300be5d](https://github.com/puppeteer/puppeteer/commit/300be5d167b6e7e532e725fdb86966081a5d0093))
- add more Android models to DeviceDescriptors ([#7210](https://github.com/puppeteer/puppeteer/issues/7210)) ([b5020dc](https://github.com/puppeteer/puppeteer/commit/b5020dc04121b265c77662237dfb177d6de06053)), closes [/github.com/aerokube/moon-deploy/blob/master/moon-local.yaml#L199](https://github.com/puppeteer//github.com/aerokube/moon-deploy/blob/master/moon-local.yaml/issues/L199)
- add proxy and bypass list parameters to createIncognitoBrowserContext ([#7516](https://github.com/puppeteer/puppeteer/issues/7516)) ([8e45a1c](https://github.com/puppeteer/puppeteer/commit/8e45a1c882207cc36e87be2a917b661eb841c4bf)), closes [#678](https://github.com/puppeteer/puppeteer/issues/678)
- add threshold to Page.isIntersectingViewport ([#6497](https://github.com/puppeteer/puppeteer/issues/6497)) ([54c4318](https://github.com/puppeteer/puppeteer/commit/54c43180161c3c512e4698e7f2e85ce3c6f0ab50))
- add unit test support for bisect ([#7553](https://github.com/puppeteer/puppeteer/issues/7553)) ([a0b1f6b](https://github.com/puppeteer/puppeteer/commit/a0b1f6b401abae2fbc5a8987061644adfaa7b482))
- add User-Agent with Puppeteer version to WebSocket request ([#5614](https://github.com/puppeteer/puppeteer/issues/5614)) ([6a2bf0a](https://github.com/puppeteer/puppeteer/commit/6a2bf0aabaa4df72c7838f5a6cd742e8f9c72be6))
- extend husky checks ([#7574](https://github.com/puppeteer/puppeteer/issues/7574)) ([7316086](https://github.com/puppeteer/puppeteer/commit/73160869417275200be19bd37372b6218dbc5f63))
- **api:** implement `Page.waitForNetworkIdle()` ([#5140](https://github.com/puppeteer/puppeteer/issues/5140)) ([3c6029c](https://github.com/puppeteer/puppeteer/commit/3c6029c702291ca7ef637b66e78d72e03156fe58))
- **coverage:** option for raw V8 script coverage ([#6454](https://github.com/puppeteer/puppeteer/issues/6454)) ([cb4470a](https://github.com/puppeteer/puppeteer/commit/cb4470a6d9b0a7f73836458bb3d5779eb85ac5f2))
- support timeout for page.pdf() call ([#7508](https://github.com/puppeteer/puppeteer/issues/7508)) ([f90af66](https://github.com/puppeteer/puppeteer/commit/f90af6639d801e764bdb479b9543b7f8f2b926df))
- **typescript:** allow using puppeteer without dom lib ([#6998](https://github.com/puppeteer/puppeteer/issues/6998)) ([723052d](https://github.com/puppeteer/puppeteer/commit/723052d5bb3c3d1d3908508467512bea4d8fdc80)), closes [#6989](https://github.com/puppeteer/puppeteer/issues/6989)

### Bug Fixes

- **docs:** deploy includes website documentation ([#7469](https://github.com/puppeteer/puppeteer/issues/7469)) ([6fde41c](https://github.com/puppeteer/puppeteer/commit/6fde41c6b6657986df1bbce3f2e0f7aa499f2be4))
- **docs:** names in version 9.1.1 ([#7517](https://github.com/puppeteer/puppeteer/issues/7517)) ([44b22bb](https://github.com/puppeteer/puppeteer/commit/44b22bbc2629e3c75c1494b299a66790b371fb0a))
- **frame:** fix Frame.waitFor's XPath pattern detection ([#5184](https://github.com/puppeteer/puppeteer/issues/5184)) ([caa2b73](https://github.com/puppeteer/puppeteer/commit/caa2b732fe58f32ec03f2a9fa8568f20188203c5))
- **install:** respect environment proxy config when downloading Firef… ([#6577](https://github.com/puppeteer/puppeteer/issues/6577)) ([9399c97](https://github.com/puppeteer/puppeteer/commit/9399c9786fba4e45e1c5485ddbb197d2d4f1735f)), closes [#6573](https://github.com/puppeteer/puppeteer/issues/6573)
- added names in V9.1.1 ([#7547](https://github.com/puppeteer/puppeteer/issues/7547)) ([d132b8b](https://github.com/puppeteer/puppeteer/commit/d132b8b041696e6d5b9a99d0be1acf1cf943efef))
- **test:** tweak waitForNetworkIdle delay in test between downloads ([#7564](https://github.com/puppeteer/puppeteer/issues/7564)) ([a21b737](https://github.com/puppeteer/puppeteer/commit/a21b7376e7feaf23066d67948d52480516f42496))
- **types:** allow evaluate functions to take a readonly array as an argument ([#7072](https://github.com/puppeteer/puppeteer/issues/7072)) ([491614c](https://github.com/puppeteer/puppeteer/commit/491614c7f8cfa50b902d0275064e611c2a48c3b2))
- update firefox prefs documentation link ([#7539](https://github.com/puppeteer/puppeteer/issues/7539)) ([2aec355](https://github.com/puppeteer/puppeteer/commit/2aec35553bc6e0305f40837bb3665ddbd02aa889))
- use non-deprecated tracing categories api ([#7413](https://github.com/puppeteer/puppeteer/issues/7413)) ([040a0e5](https://github.com/puppeteer/puppeteer/commit/040a0e561b4f623f7929130b90be129f94ebb642))

## [10.2.0](https://github.com/puppeteer/puppeteer/compare/v10.1.0...v10.2.0) (2021-08-04)

### Features

- **api:** make `page.isDragInterceptionEnabled` a method ([#7419](https://github.com/puppeteer/puppeteer/issues/7419)) ([dd470c7](https://github.com/puppeteer/puppeteer/commit/dd470c7a226a8422a938a7b0fffa58ffc6b78512)), closes [#7150](https://github.com/puppeteer/puppeteer/issues/7150)
- **chromium:** roll to Chromium 93.0.4577.0 (r901912) ([#7387](https://github.com/puppeteer/puppeteer/issues/7387)) ([e10faad](https://github.com/puppeteer/puppeteer/commit/e10faad4f239b1120491bb54fcba0216acd3a646))
- add channel parameter for puppeteer.launch ([#7389](https://github.com/puppeteer/puppeteer/issues/7389)) ([d70f60e](https://github.com/puppeteer/puppeteer/commit/d70f60e0619b8659d191fa492e3db4bc221ae982))
- add cooperative request intercepts ([#6735](https://github.com/puppeteer/puppeteer/issues/6735)) ([b5e6474](https://github.com/puppeteer/puppeteer/commit/b5e6474374ae6a88fc73cdb1a9906764c2ac5d70))
- add support for useragentdata ([#7378](https://github.com/puppeteer/puppeteer/issues/7378)) ([7200b1a](https://github.com/puppeteer/puppeteer/commit/7200b1a6fb9dfdfb65d50f0000339333e71b1b2a))

### Bug Fixes

- **browser-runner:** reject promise on error ([#7338](https://github.com/puppeteer/puppeteer/issues/7338)) ([5eb20e2](https://github.com/puppeteer/puppeteer/commit/5eb20e29a21ea0e0368fa8937ef38f7c7693ab34))
- add script to remove html comments from docs markdown ([#7394](https://github.com/puppeteer/puppeteer/issues/7394)) ([ea3df80](https://github.com/puppeteer/puppeteer/commit/ea3df80ed136a03d7698d2319106af5df8d48b58))

## [10.1.0](https://github.com/puppeteer/puppeteer/compare/v10.0.0...v10.1.0) (2021-06-29)

### Features

- add a streaming version for page.pdf ([e3699e2](https://github.com/puppeteer/puppeteer/commit/e3699e248bc9c1f7a6ead9a07d68ae8b65905443))
- add drag-and-drop support ([#7150](https://github.com/puppeteer/puppeteer/issues/7150)) ([a91b8ac](https://github.com/puppeteer/puppeteer/commit/a91b8aca3728b2c2e310e9446897d729bf983377))
- add page.emulateCPUThrottling ([#7343](https://github.com/puppeteer/puppeteer/issues/7343)) ([4ce4110](https://github.com/puppeteer/puppeteer/commit/4ce41106288938b9d366c550e7a424812920683d))

### Bug Fixes

- remove redundant await while fetching target ([#7351](https://github.com/puppeteer/puppeteer/issues/7351)) ([083b297](https://github.com/puppeteer/puppeteer/commit/083b297a6741c6b1dd23867f441130655fac8f7d))

## [10.0.0](https://github.com/puppeteer/puppeteer/compare/v9.1.1...v10.0.0) (2021-05-31)

### ⚠ BREAKING CHANGES

- Node.js 10 is no longer supported.

### Features

- **chromium:** roll to Chromium 92.0.4512.0 (r884014) ([#7288](https://github.com/puppeteer/puppeteer/issues/7288)) ([f863f4b](https://github.com/puppeteer/puppeteer/commit/f863f4bfe015e57ea1f9fbb322f1cedee468b857))
- **requestinterception:** remove cacheSafe flag ([#7217](https://github.com/puppeteer/puppeteer/issues/7217)) ([d01aa6c](https://github.com/puppeteer/puppeteer/commit/d01aa6c84a1e41f15ffed3a8d36ad26a404a7187))
- expose other sessions from connection ([#6863](https://github.com/puppeteer/puppeteer/issues/6863)) ([cb285a2](https://github.com/puppeteer/puppeteer/commit/cb285a237921259eac99ade1d8b5550e068a55eb))
- **launcher:** add new launcher option `waitForInitialPage` ([#7105](https://github.com/puppeteer/puppeteer/issues/7105)) ([2605309](https://github.com/puppeteer/puppeteer/commit/2605309f74b43da160cda4d214016e4422bf7676)), closes [#3630](https://github.com/puppeteer/puppeteer/issues/3630)

### Bug Fixes

- added comments for browsercontext, startCSSCoverage, and startJSCoverage. ([#7264](https://github.com/puppeteer/puppeteer/issues/7264)) ([b750397](https://github.com/puppeteer/puppeteer/commit/b75039746ac6bddf1411538242b5e70b0f2e6e8a))
- modified comment for method product, platform and newPage ([#7262](https://github.com/puppeteer/puppeteer/issues/7262)) ([159d283](https://github.com/puppeteer/puppeteer/commit/159d2835450697dabea6f9adf6e67d158b5b8ae3))
- **requestinterception:** fix font loading issue ([#7060](https://github.com/puppeteer/puppeteer/issues/7060)) ([c9978d2](https://github.com/puppeteer/puppeteer/commit/c9978d20d5584c9fd2dc902e4b4ac86ed8ea5d6e)), closes [/github.com/puppeteer/puppeteer/pull/6996#issuecomment-811546501](https://github.com/puppeteer//github.com/puppeteer/puppeteer/pull/6996/issues/issuecomment-811546501) [/github.com/puppeteer/puppeteer/pull/6996#issuecomment-813797393](https://github.com/puppeteer//github.com/puppeteer/puppeteer/pull/6996/issues/issuecomment-813797393) [#7038](https://github.com/puppeteer/puppeteer/issues/7038)
- drop support for Node.js 10 ([#7200](https://github.com/puppeteer/puppeteer/issues/7200)) ([97c9fe2](https://github.com/puppeteer/puppeteer/commit/97c9fe2520723d45a5a86da06b888ae888d400be)), closes [#6753](https://github.com/puppeteer/puppeteer/issues/6753)

## [9.1.1](https://github.com/puppeteer/puppeteer/compare/v9.1.0...v9.1.1) (2021-05-05)

### Bug Fixes

- make targetFilter synchronous ([#7203](https://github.com/puppeteer/puppeteer/issues/7203)) ([bcc85a0](https://github.com/puppeteer/puppeteer/commit/bcc85a0969077d122e5d8d2fb5c1061999a8ae48))

## [9.1.0](https://github.com/puppeteer/puppeteer/compare/v9.0.0...v9.1.0) (2021-05-03)

### Features

- add option to filter targets ([#7192](https://github.com/puppeteer/puppeteer/issues/7192)) ([ec3fc2e](https://github.com/puppeteer/puppeteer/commit/ec3fc2e035bb5ca14a576180fff612e1ecf6bad7))

### Bug Fixes

- change rm -rf to rimraf ([#7168](https://github.com/puppeteer/puppeteer/issues/7168)) ([ad6b736](https://github.com/puppeteer/puppeteer/commit/ad6b736039436fcc5c0a262e5b575aa041427be3))

## [9.0.0](https://github.com/puppeteer/puppeteer/compare/v8.0.0...v9.0.0) (2021-04-21)

### ⚠ BREAKING CHANGES

- **filechooser:** FileChooser.cancel() is now synchronous.

### Features

- **chromium:** roll to Chromium 91.0.4469.0 (r869685) ([#7110](https://github.com/puppeteer/puppeteer/issues/7110)) ([715e7a8](https://github.com/puppeteer/puppeteer/commit/715e7a8d62901d1c7ec602425c2fce8d8148b742))
- **launcher:** fix installation error on Apple M1 chips ([#7099](https://github.com/puppeteer/puppeteer/issues/7099)) ([c239d9e](https://github.com/puppeteer/puppeteer/commit/c239d9edc72d85697b4875c98fff3ec592848082)), closes [#6622](https://github.com/puppeteer/puppeteer/issues/6622)
- **network:** request interception and caching compatibility ([#6996](https://github.com/puppeteer/puppeteer/issues/6996)) ([8695759](https://github.com/puppeteer/puppeteer/commit/8695759a223bc1bd31baecb00dc28721216e4c6f))
- **page:** emit the event after removing the Worker ([#7080](https://github.com/puppeteer/puppeteer/issues/7080)) ([e34a6d5](https://github.com/puppeteer/puppeteer/commit/e34a6d53183c3e1f63a375ba6a26bee0dcfcf542))
- **types:** improve type of predicate function ([#6997](https://github.com/puppeteer/puppeteer/issues/6997)) ([943477c](https://github.com/puppeteer/puppeteer/commit/943477cc1eb4b129870142873b3554737d5ef252)), closes [/github.com/DefinitelyTyped/DefinitelyTyped/blob/c43191a8f7a7d2a47bbff0bc3a7d95ecc64d2269/types/puppeteer/index.d.ts#L1883-L1885](https://github.com/puppeteer//github.com/DefinitelyTyped/DefinitelyTyped/blob/c43191a8f7a7d2a47bbff0bc3a7d95ecc64d2269/types/puppeteer/index.d.ts/issues/L1883-L1885)
- accept captureBeyondViewport as optional screenshot param ([#7063](https://github.com/puppeteer/puppeteer/issues/7063)) ([0e092d2](https://github.com/puppeteer/puppeteer/commit/0e092d2ea0ec18ad7f07ad3507deb80f96086e7a))
- **page:** add omitBackground option for page.pdf method ([#6981](https://github.com/puppeteer/puppeteer/issues/6981)) ([dc8ab6d](https://github.com/puppeteer/puppeteer/commit/dc8ab6d8ca1661f8e56d329e6d9c49c891e8b975))

### Bug Fixes

- **aria:** fix parsing of ARIA selectors ([#7037](https://github.com/puppeteer/puppeteer/issues/7037)) ([4426135](https://github.com/puppeteer/puppeteer/commit/4426135692ae3ee7ed2841569dd9375e7ca8286c))
- **page:** fix mouse.click method ([#7097](https://github.com/puppeteer/puppeteer/issues/7097)) ([ba7c367](https://github.com/puppeteer/puppeteer/commit/ba7c367de33ace7753fd9d8b8cc894b2c14ab6c2)), closes [#6462](https://github.com/puppeteer/puppeteer/issues/6462) [#3347](https://github.com/puppeteer/puppeteer/issues/3347)
- make `$` and `$$` selectors generic ([#6883](https://github.com/puppeteer/puppeteer/issues/6883)) ([b349c91](https://github.com/puppeteer/puppeteer/commit/b349c91e7df76630b7411d6645e649945c4609bd))
- type page event listeners correctly ([#6891](https://github.com/puppeteer/puppeteer/issues/6891)) ([866d34e](https://github.com/puppeteer/puppeteer/commit/866d34ee1122e89eab00743246676845bb065968))
- **typescript:** allow defaultViewport to be 'null' ([#6942](https://github.com/puppeteer/puppeteer/issues/6942)) ([e31e68d](https://github.com/puppeteer/puppeteer/commit/e31e68dfa12dd50482b700472bc98876b9031829)), closes [#6885](https://github.com/puppeteer/puppeteer/issues/6885)
- make screenshots work in puppeteer-web ([#6936](https://github.com/puppeteer/puppeteer/issues/6936)) ([5f24f60](https://github.com/puppeteer/puppeteer/commit/5f24f608194fd4252da7b288461427cabc9dabb3))
- **filechooser:** cancel is sync ([#6937](https://github.com/puppeteer/puppeteer/issues/6937)) ([2ba61e0](https://github.com/puppeteer/puppeteer/commit/2ba61e04e923edaac09c92315212552f2d4ce676))
- **network:** don't disable cache for auth challenge ([#6962](https://github.com/puppeteer/puppeteer/issues/6962)) ([1c2479a](https://github.com/puppeteer/puppeteer/commit/1c2479a6cd4bd09a577175ffd31c40ca6f4279b8))

## [8.0.0](https://github.com/puppeteer/puppeteer/compare/v7.1.0...v8.0.0) (2021-02-26)

### ⚠ BREAKING CHANGES

- renamed type `ChromeArgOptions` to `BrowserLaunchArgumentOptions`
- renamed type `BrowserOptions` to `BrowserConnectOptions`

### Features

- **chromium:** roll Chromium to r856583 ([#6927](https://github.com/puppeteer/puppeteer/issues/6927)) ([0c688bd](https://github.com/puppeteer/puppeteer/commit/0c688bd75ef1d1fc3afd14cbe8966757ecda68fb))

### Bug Fixes

- explicit HTTPRequest.resourceType type defs ([#6882](https://github.com/puppeteer/puppeteer/issues/6882)) ([ff26c62](https://github.com/puppeteer/puppeteer/commit/ff26c62647b60cd0d8d7ea66ee998adaadc3fcc2)), closes [#6854](https://github.com/puppeteer/puppeteer/issues/6854)
- expose `Viewport` type ([#6881](https://github.com/puppeteer/puppeteer/issues/6881)) ([be7c229](https://github.com/puppeteer/puppeteer/commit/be7c22933c1dcf5eee797d61463171bd0ef44582))
- improve TS types for launching browsers ([#6888](https://github.com/puppeteer/puppeteer/issues/6888)) ([98c8145](https://github.com/puppeteer/puppeteer/commit/98c81458c27f378eb66c38e1620e79e2ffde418e))
- move CI npm config out of .npmrc ([#6901](https://github.com/puppeteer/puppeteer/issues/6901)) ([f7de60b](https://github.com/puppeteer/puppeteer/commit/f7de60be22d9bc6433ada7bfefeaa7f6f6f62047))

## [7.1.0](https://github.com/puppeteer/puppeteer/compare/v7.0.4...v7.1.0) (2021-02-12)

### Features

- **page:** add color-gamut support to Page.emulateMediaFeatures ([#6857](https://github.com/puppeteer/puppeteer/issues/6857)) ([ad59357](https://github.com/puppeteer/puppeteer/commit/ad5935738d869cfce386a0d28b4bc6131457f962)), closes [#6761](https://github.com/puppeteer/puppeteer/issues/6761)

### Bug Fixes

- add favicon test asset ([#6868](https://github.com/puppeteer/puppeteer/issues/6868)) ([a63f53c](https://github.com/puppeteer/puppeteer/commit/a63f53c9380545550503f5539494c72c607e19ac))
- expose `ScreenshotOptions` type in type defs ([#6869](https://github.com/puppeteer/puppeteer/issues/6869)) ([63d48b2](https://github.com/puppeteer/puppeteer/commit/63d48b2ecba317b6c0a3acad87a7a3671c769dbc)), closes [#6866](https://github.com/puppeteer/puppeteer/issues/6866)
- expose puppeteer.Permission type ([#6856](https://github.com/puppeteer/puppeteer/issues/6856)) ([a5e174f](https://github.com/puppeteer/puppeteer/commit/a5e174f696eb192c541db64a603ea5cdf385a643))
- jsonValue() type is generic ([#6865](https://github.com/puppeteer/puppeteer/issues/6865)) ([bdaba78](https://github.com/puppeteer/puppeteer/commit/bdaba7829da366aabbc81885d84bb2401ab3eaff))
- wider compat TS types and CI checks to ensure correct type defs ([#6855](https://github.com/puppeteer/puppeteer/issues/6855)) ([6a0eb78](https://github.com/puppeteer/puppeteer/commit/6a0eb7841fd82493903b0b9fa153d2de181350eb))

## [7.0.4](https://github.com/puppeteer/puppeteer/compare/v7.0.3...v7.0.4) (2021-02-09)

### Bug Fixes

- make publish bot run full build, not just tsc ([#6848](https://github.com/puppeteer/puppeteer/issues/6848)) ([f718b14](https://github.com/puppeteer/puppeteer/commit/f718b14b64df8be492d344ddd35e40961ff750c5))

## [7.0.3](https://github.com/puppeteer/puppeteer/compare/v7.0.2...v7.0.3) (2021-02-09)

### Bug Fixes

- include lib/types.d.ts in files list ([#6844](https://github.com/puppeteer/puppeteer/issues/6844)) ([e34f317](https://github.com/puppeteer/puppeteer/commit/e34f317b37533256a063c1238609b488d263b998))

## [7.0.2](https://github.com/puppeteer/puppeteer/compare/v7.0.1...v7.0.2) (2021-02-09)

### Bug Fixes

- much better TypeScript definitions ([#6837](https://github.com/puppeteer/puppeteer/issues/6837)) ([f1b46ab](https://github.com/puppeteer/puppeteer/commit/f1b46ab5faa262f893c17923579d0cf52268a764))
- **domworld:** reset bindings when context changes ([#6766](https://github.com/puppeteer/puppeteer/issues/6766)) ([#6836](https://github.com/puppeteer/puppeteer/issues/6836)) ([4e8d074](https://github.com/puppeteer/puppeteer/commit/4e8d074c2f8384a2f283f5edf9ef69c40bd8464f))
- **launcher:** output correct error message for browser ([#6815](https://github.com/puppeteer/puppeteer/issues/6815)) ([6c61874](https://github.com/puppeteer/puppeteer/commit/6c618747979c3a08f2727e9e22fe45cade8c926a))

## [7.0.1](https://github.com/puppeteer/puppeteer/compare/v7.0.0...v7.0.1) (2021-02-04)

### Bug Fixes

- **typescript:** ship .d.ts file in npm package ([#6811](https://github.com/puppeteer/puppeteer/issues/6811)) ([a7e3c2e](https://github.com/puppeteer/puppeteer/commit/a7e3c2e09e9163eee2f15221aafa4400e6a75f91))

## [7.0.0](https://github.com/puppeteer/puppeteer/compare/v6.0.0...v7.0.0) (2021-02-03)

### ⚠ BREAKING CHANGES

- - `page.screenshot` makes a screenshot with the clip dimensions, not cutting it by the ViewPort size.
- **chromium:** - `page.screenshot` cuts screenshot content by the ViewPort size, not ViewPort position.

### Features

- use `captureBeyondViewport` in `Page.captureScreenshot` ([#6805](https://github.com/puppeteer/puppeteer/issues/6805)) ([401d84e](https://github.com/puppeteer/puppeteer/commit/401d84e4a3508f9ca5c24dbfcad2a71571b1b8eb))
- **chromium:** roll Chromium to r848005 ([#6801](https://github.com/puppeteer/puppeteer/issues/6801)) ([890d5c2](https://github.com/puppeteer/puppeteer/commit/890d5c2e57cdee7d73915a878bda86b72e26b608))

## [6.0.0](https://github.com/puppeteer/puppeteer/compare/v5.5.0...v6.0.0) (2021-02-02)

### ⚠ BREAKING CHANGES

- **chromium:** The built-in `aria/` selector query handler doesn’t return ignored elements anymore.

### Features

- **chromium:** roll Chromium to r843427 ([#6797](https://github.com/puppeteer/puppeteer/issues/6797)) ([8f9fbdb](https://github.com/puppeteer/puppeteer/commit/8f9fbdbae68254600a9c73ab05f36146c975dba6)), closes [#6758](https://github.com/puppeteer/puppeteer/issues/6758)
- add page.emulateNetworkConditions ([#6759](https://github.com/puppeteer/puppeteer/issues/6759)) ([5ea76e9](https://github.com/puppeteer/puppeteer/commit/5ea76e9333c42ab5a751ca01aa5676a662f6c063))
- **types:** expose typedefs to consumers ([#6745](https://github.com/puppeteer/puppeteer/issues/6745)) ([ebd087a](https://github.com/puppeteer/puppeteer/commit/ebd087a31661a1b701650d0be3e123cc5a813bd8))
- add iPhone 11 models to DeviceDescriptors ([#6467](https://github.com/puppeteer/puppeteer/issues/6467)) ([50b810d](https://github.com/puppeteer/puppeteer/commit/50b810dab7fae5950ba086295462788f91ff1e6f))
- support fetching and launching on Apple M1 ([9a8479a](https://github.com/puppeteer/puppeteer/commit/9a8479a52a7d8b51690b0732b2a10816cd1b8aef)), closes [#6495](https://github.com/puppeteer/puppeteer/issues/6495) [#6634](https://github.com/puppeteer/puppeteer/issues/6634) [#6641](https://github.com/puppeteer/puppeteer/issues/6641) [#6614](https://github.com/puppeteer/puppeteer/issues/6614)
- support promise as return value for page.waitForResponse predicate ([#6624](https://github.com/puppeteer/puppeteer/issues/6624)) ([b57f3fc](https://github.com/puppeteer/puppeteer/commit/b57f3fcd5393c68f51d82e670b004f5b116dcbc3))

### Bug Fixes

- **domworld:** fix waitfor bindings ([#6766](https://github.com/puppeteer/puppeteer/issues/6766)) ([#6775](https://github.com/puppeteer/puppeteer/issues/6775)) ([cac540b](https://github.com/puppeteer/puppeteer/commit/cac540be3ab8799a1d77b0951b16bc22ea1c2adb))
- **launcher:** rename TranslateUI to Translate to match Chrome ([#6692](https://github.com/puppeteer/puppeteer/issues/6692)) ([d901696](https://github.com/puppeteer/puppeteer/commit/d901696e0d8901bcb23cf676a5e5ac562f821a0d))
- do not use old utility world ([#6528](https://github.com/puppeteer/puppeteer/issues/6528)) ([fb85911](https://github.com/puppeteer/puppeteer/commit/fb859115c0e2829bae1d1b32edbf642988e2ef76)), closes [#6527](https://github.com/puppeteer/puppeteer/issues/6527)
- update to https-proxy-agent@^5.0.0 to fix `ERR_INVALID_PROTOCOL` ([#6555](https://github.com/puppeteer/puppeteer/issues/6555)) ([3bf5a55](https://github.com/puppeteer/puppeteer/commit/3bf5a552890ee80cc4326b1e430424b0fdad4363))

## [5.5.0](https://github.com/puppeteer/puppeteer/compare/v5.4.1...v5.5.0) (2020-11-16)

### Features

- **chromium:** roll Chromium to r818858 ([#6526](https://github.com/puppeteer/puppeteer/issues/6526)) ([b549256](https://github.com/puppeteer/puppeteer/commit/b54925695200cad32f470f8eb407259606447a85))

### Bug Fixes

- **common:** fix generic type of `_isClosedPromise` ([#6579](https://github.com/puppeteer/puppeteer/issues/6579)) ([122f074](https://github.com/puppeteer/puppeteer/commit/122f074f92f47a7b9aa08091851e51a07632d23b))
- **domworld:** fix missing binding for waittasks ([#6562](https://github.com/puppeteer/puppeteer/issues/6562)) ([67da1cf](https://github.com/puppeteer/puppeteer/commit/67da1cf866703f5f581c9cce4923697ac38129ef))

    ---
sidebar_label: API
---

# API Reference

## Classes

<table><thead><tr><th>

Class

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="accessibility">[Accessibility](./puppeteer.accessibility.md)</span>

</td><td>

The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access).

**Remarks:**

Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output.

Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree.

Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class.

</td></tr>
<tr><td>

<span id="browser">[Browser](./puppeteer.browser.md)</span>

</td><td>

[Browser](./puppeteer.browser.md) represents a browser instance that is either:

- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md).

[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.emit.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Browser` class.

</td></tr>
<tr><td>

<span id="browsercontext">[BrowserContext](./puppeteer.browsercontext.md)</span>

</td><td>

[BrowserContext](./puppeteer.browsercontext.md) represents individual user contexts within a [browser](./puppeteer.browser.md).

When a [browser](./puppeteer.browser.md) is launched, it has at least one default [browser context](./puppeteer.browsercontext.md). Others can be created using [Browser.createBrowserContext()](./puppeteer.browser.createbrowsercontext.md). Each context has isolated storage (cookies/localStorage/etc.)

[BrowserContext](./puppeteer.browsercontext.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserContextEvent](./puppeteer.browsercontextevent.md) enum.

If a [page](./puppeteer.page.md) opens another [page](./puppeteer.page.md), e.g. using `window.open`, the popup will belong to the parent [page's browser context](./puppeteer.page.browsercontext.md).

**Remarks:**

In Chrome all non-default contexts are incognito, and [default browser context](./puppeteer.browser.defaultbrowsercontext.md) might be incognito if you provide the `--incognito` argument when launching the browser.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserContext` class.

</td></tr>
<tr><td>

<span id="browserlauncher">[BrowserLauncher](./puppeteer.browserlauncher.md)</span>

</td><td>

Describes a launcher - a class that is able to create and launch a browser instance.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserLauncher` class.

</td></tr>
<tr><td>

<span id="cdpsession">[CDPSession](./puppeteer.cdpsession.md)</span>

</td><td>

The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.

**Remarks:**

Protocol methods can be called with [CDPSession.send()](./puppeteer.cdpsession.send.md) method and protocol events can be subscribed to with `CDPSession.on` method.

Useful links: [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/) and [Getting Started with DevTools Protocol](https://github.com/aslushnikov/getting-started-with-cdp/blob/HEAD/README.md).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `CDPSession` class.

</td></tr>
<tr><td>

<span id="connection">[Connection](./puppeteer.connection.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="connectionclosederror">[ConnectionClosedError](./puppeteer.connectionclosederror.md)</span>

</td><td>

Thrown if underlying protocol connection has been closed.

</td></tr>
<tr><td>

<span id="consolemessage">[ConsoleMessage](./puppeteer.consolemessage.md)</span>

</td><td>

ConsoleMessage objects are dispatched by page via the 'console' event.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ConsoleMessage` class.

</td></tr>
<tr><td>

<span id="coverage">[Coverage](./puppeteer.coverage.md)</span>

</td><td>

The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page.

**Remarks:**

To output coverage in a form consumable by [Istanbul](https://github.com/istanbuljs), see [puppeteer-to-istanbul](https://github.com/istanbuljs/puppeteer-to-istanbul).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Coverage` class.

</td></tr>
<tr><td>

<span id="csscoverage">[CSSCoverage](./puppeteer.csscoverage.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="devicerequestprompt">[DeviceRequestPrompt](./puppeteer.devicerequestprompt.md)</span>

</td><td>

Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth.

**Remarks:**

`DeviceRequestPrompt` instances are returned via the [Page.waitForDevicePrompt()](./puppeteer.page.waitfordeviceprompt.md) method.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `DeviceRequestPrompt` class.

</td></tr>
<tr><td>

<span id="devicerequestpromptdevice">[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)</span>

</td><td>

Device in a request prompt.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `DeviceRequestPromptDevice` class.

</td></tr>
<tr><td>

<span id="dialog">[Dialog](./puppeteer.dialog.md)</span>

</td><td>

Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the `dialog` event.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Dialog` class.

</td></tr>
<tr><td>

<span id="elementhandle">[ElementHandle](./puppeteer.elementhandle.md)</span>

</td><td>

ElementHandle represents an in-page DOM element.

**Remarks:**

ElementHandles can be created with the [Page.$()](./puppeteer.page._.md) method.

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  const hrefElement = await page.$('a');
  await hrefElement.click();
  // ...
})();
```

ElementHandle prevents the DOM element from being garbage-collected unless the handle is [disposed](./puppeteer.jshandle.dispose.md). ElementHandles are auto-disposed when their origin frame gets navigated.

ElementHandle instances can be used as arguments in [Page.$eval()](./puppeteer.page._eval.md) and [Page.evaluate()](./puppeteer.page.evaluate.md) methods.

If you're using TypeScript, ElementHandle takes a generic argument that denotes the type of element the handle is holding within. For example, if you have a handle to a `<select>` element, you can type it as `ElementHandle<HTMLSelectElement>` and you get some nicer type checks.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ElementHandle` class.

</td></tr>
<tr><td>

<span id="eventemitter">[EventEmitter](./puppeteer.eventemitter.md)</span>

</td><td>

The EventEmitter class that many Puppeteer classes extend.

**Remarks:**

This allows you to listen to events that Puppeteer classes fire and act accordingly. Therefore you'll mostly use [on](./puppeteer.eventemitter.on.md) and [off](./puppeteer.eventemitter.off.md) to bind and unbind to event listeners.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `EventEmitter` class.

</td></tr>
<tr><td>

<span id="extensiontransport">[ExtensionTransport](./puppeteer.extensiontransport.md)</span>

</td><td>

**_(Experimental)_** Experimental ExtensionTransport allows establishing a connection via chrome.debugger API if Puppeteer runs in an extension. Since Chrome DevTools Protocol is restricted for extensions, the transport implements missing commands and events.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ExtensionTransport` class.

</td></tr>
<tr><td>

<span id="filechooser">[FileChooser](./puppeteer.filechooser.md)</span>

</td><td>

File choosers let you react to the page requesting for a file.

**Remarks:**

`FileChooser` instances are returned via the [Page.waitForFileChooser()](./puppeteer.page.waitforfilechooser.md) method.

In browsers, only one file chooser can be opened at a time. All file choosers must be accepted or canceled. Not doing so will prevent subsequent file choosers from appearing.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `FileChooser` class.

</td></tr>
<tr><td>

<span id="frame">[Frame](./puppeteer.frame.md)</span>

</td><td>

Represents a DOM frame.

To understand frames, you can think of frames as `<iframe>` elements. Just like iframes, frames can be nested, and when JavaScript is executed in a frame, the JavaScript does not affect frames inside the ambient frame the JavaScript executes in.

**Remarks:**

Frame lifecycles are controlled by three events that are all dispatched on the parent [page](./puppeteer.frame.page.md):

- [PageEvent.FrameAttached](./puppeteer.pageevent.md) - [PageEvent.FrameNavigated](./puppeteer.pageevent.md) - [PageEvent.FrameDetached](./puppeteer.pageevent.md)

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Frame` class.

</td></tr>
<tr><td>

<span id="httprequest">[HTTPRequest](./puppeteer.httprequest.md)</span>

</td><td>

Represents an HTTP request sent by a page.

**Remarks:**

Whenever the page sends a request, such as for a network resource, the following events are emitted by Puppeteer's `page`:

- `request`: emitted when the request is issued by the page.

- `requestfinished` - emitted when the response body is downloaded and the request is complete.

If request fails at some point, then instead of `requestfinished` event the `requestfailed` event is emitted.

All of these events provide an instance of `HTTPRequest` representing the request that occurred:

```
page.on('request', request => ...)
```

NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with `requestfinished` event.

If request gets a 'redirect' response, the request is successfully finished with the `requestfinished` event, and a new request is issued to a redirected url.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `HTTPRequest` class.

</td></tr>
<tr><td>

<span id="httpresponse">[HTTPResponse](./puppeteer.httpresponse.md)</span>

</td><td>

The HTTPResponse class represents responses which are received by the [Page](./puppeteer.page.md) class.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `HTTPResponse` class.

</td></tr>
<tr><td>

<span id="jscoverage">[JSCoverage](./puppeteer.jscoverage.md)</span>

</td><td>

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `JSCoverage` class.

</td></tr>
<tr><td>

<span id="jshandle">[JSHandle](./puppeteer.jshandle.md)</span>

</td><td>

Represents a reference to a JavaScript object. Instances can be created using [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md).

Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely [disposed](./puppeteer.jshandle.dispose.md). JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed.

Handles can be used as arguments for any evaluation function such as [Page.$eval()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). They are resolved to their referenced object.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `JSHandle` class.

</td></tr>
<tr><td>

<span id="keyboard">[Keyboard](./puppeteer.keyboard.md)</span>

</td><td>

Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page.

**Remarks:**

For finer control, you can use [Keyboard.down()](./puppeteer.keyboard.down.md), [Keyboard.up()](./puppeteer.keyboard.up.md), and [Keyboard.sendCharacter()](./puppeteer.keyboard.sendcharacter.md) to manually fire events as if they were generated from a real keyboard.

On macOS, keyboard shortcuts like `⌘ A` -&gt; Select All do not work. See [\#1313](https://github.com/puppeteer/puppeteer/issues/1313).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Keyboard` class.

</td></tr>
<tr><td>

<span id="locator">[Locator](./puppeteer.locator.md)</span>

</td><td>

Locators describe a strategy of locating objects and performing an action on them. If the action fails because the object is not ready for the action, the whole operation is retried. Various preconditions for a successful action are checked automatically.

See [https://pptr.dev/guides/page-interactions\#locators](https://pptr.dev/guides/page-interactions#locators) for details.

</td></tr>
<tr><td>

<span id="mouse">[Mouse](./puppeteer.mouse.md)</span>

</td><td>

The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.

**Remarks:**

Every `page` object has its own Mouse, accessible with [Page.mouse](./puppeteer.page.md#mouse).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Mouse` class.

</td></tr>
<tr><td>

<span id="page">[Page](./puppeteer.page.md)</span>

</td><td>

Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in the browser.

:::note

One Browser instance might have multiple Page instances.

:::

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Page` class.

</td></tr>
<tr><td>

<span id="protocolerror">[ProtocolError](./puppeteer.protocolerror.md)</span>

</td><td>

ProtocolError is emitted whenever there is an error from the protocol.

</td></tr>
<tr><td>

<span id="puppeteer">[Puppeteer](./puppeteer.puppeteer.md)</span>

</td><td>

The main Puppeteer class.

IMPORTANT: if you are using Puppeteer in a Node environment, you will get an instance of [PuppeteerNode](./puppeteer.puppeteernode.md) when you import or require `puppeteer`. That class extends `Puppeteer`, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Puppeteer` class.

</td></tr>
<tr><td>

<span id="puppeteererror">[PuppeteerError](./puppeteer.puppeteererror.md)</span>

</td><td>

The base class for all Puppeteer-specific errors

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `PuppeteerError` class.

</td></tr>
<tr><td>

<span id="puppeteernode">[PuppeteerNode](./puppeteer.puppeteernode.md)</span>

</td><td>

Extends the main [Puppeteer](./puppeteer.puppeteer.md) class with Node specific behaviour for fetching and downloading browsers.

If you're using Puppeteer in a Node environment, this is the class you'll get when you run `require('puppeteer')` (or the equivalent ES `import`).

**Remarks:**

The most common method to use is [launch](./puppeteer.puppeteernode.launch.md), which is used to launch and connect to a new browser instance.

See [the main Puppeteer class](./puppeteer.puppeteer.md) for methods common to all environments, such as [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `PuppeteerNode` class.

</td></tr>
<tr><td>

<span id="screenrecorder">[ScreenRecorder](./puppeteer.screenrecorder.md)</span>

</td><td>

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ScreenRecorder` class.

</td></tr>
<tr><td>

<span id="securitydetails">[SecurityDetails](./puppeteer.securitydetails.md)</span>

</td><td>

The SecurityDetails class represents the security details of a response that was received over a secure connection.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `SecurityDetails` class.

</td></tr>
<tr><td>

<span id="target">[Target](./puppeteer.target.md)</span>

</td><td>

Target represents a [CDP target](https://chromedevtools.github.io/devtools-protocol/tot/Target/). In CDP a target is something that can be debugged such a frame, a page or a worker.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Target` class.

</td></tr>
<tr><td>

<span id="timeouterror">[TimeoutError](./puppeteer.timeouterror.md)</span>

</td><td>

TimeoutError is emitted whenever certain operations are terminated due to timeout.

**Remarks:**

Example operations are [page.waitForSelector](./puppeteer.page.waitforselector.md) or [puppeteer.launch](./puppeteer.puppeteernode.launch.md).

</td></tr>
<tr><td>

<span id="toucherror">[TouchError](./puppeteer.toucherror.md)</span>

</td><td>

TouchError is thrown when an attempt is made to move or end a touch that does not exist.

</td></tr>
<tr><td>

<span id="touchscreen">[Touchscreen](./puppeteer.touchscreen.md)</span>

</td><td>

The Touchscreen class exposes touchscreen events.

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Touchscreen` class.

</td></tr>
<tr><td>

<span id="tracing">[Tracing](./puppeteer.tracing.md)</span>

</td><td>

The Tracing class exposes the tracing audit interface.

**Remarks:**

You can use `tracing.start` and `tracing.stop` to create a trace file which can be opened in Chrome DevTools or [timeline viewer](https://chromedevtools.github.io/timeline-viewer/).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Tracing` class.

</td></tr>
<tr><td>

<span id="unsupportedoperation">[UnsupportedOperation](./puppeteer.unsupportedoperation.md)</span>

</td><td>

Puppeteer will throw this error if a method is not supported by the currently used protocol

</td></tr>
<tr><td>

<span id="webworker">[WebWorker](./puppeteer.webworker.md)</span>

</td><td>

This class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).

**Remarks:**

The events `workercreated` and `workerdestroyed` are emitted on the page object to signal the worker lifecycle.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `WebWorker` class.

</td></tr>
</tbody></table>

## Enumerations

<table><thead><tr><th>

Enumeration

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="browsercontextevent">[BrowserContextEvent](./puppeteer.browsercontextevent.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="browserevent">[BrowserEvent](./puppeteer.browserevent.md)</span>

</td><td>

All the events a [browser instance](./puppeteer.browser.md) may emit.

</td></tr>
<tr><td>

<span id="interceptresolutionaction">[InterceptResolutionAction](./puppeteer.interceptresolutionaction.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="locatorevent">[LocatorEvent](./puppeteer.locatorevent.md)</span>

</td><td>

All the events that a locator instance may emit.

</td></tr>
<tr><td>

<span id="pageevent">[PageEvent](./puppeteer.pageevent.md)</span>

</td><td>

All the events that a page instance may emit.

</td></tr>
<tr><td>

<span id="targettype">[TargetType](./puppeteer.targettype.md)</span>

</td><td>

</td></tr>
</tbody></table>

## Functions

<table><thead><tr><th>

Function

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="connect">[connect(options)](./puppeteer.connect.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="defaultargs">[defaultArgs(options)](./puppeteer.defaultargs.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="launch">[launch(options)](./puppeteer.launch.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="trimcache">[trimCache()](./puppeteer.trimcache.md)</span>

</td><td>

</td></tr>
</tbody></table>

## Interfaces

<table><thead><tr><th>

Interface

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="actionoptions">[ActionOptions](./puppeteer.actionoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="autofilldata">[AutofillData](./puppeteer.autofilldata.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="boundingbox">[BoundingBox](./puppeteer.boundingbox.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="boxmodel">[BoxModel](./puppeteer.boxmodel.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="browsercontextevents">[BrowserContextEvents](./puppeteer.browsercontextevents.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="browsercontextoptions">[BrowserContextOptions](./puppeteer.browsercontextoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="browserevents">[BrowserEvents](./puppeteer.browserevents.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="cdpsessionevents">[CDPSessionEvents](./puppeteer.cdpsessionevents.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="chromeheadlessshellsettings">[ChromeHeadlessShellSettings](./puppeteer.chromeheadlessshellsettings.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="chromesettings">[ChromeSettings](./puppeteer.chromesettings.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="clickoptions">[ClickOptions](./puppeteer.clickoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="commandoptions">[CommandOptions](./puppeteer.commandoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="commoneventemitter">[CommonEventEmitter](./puppeteer.commoneventemitter.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="configuration">[Configuration](./puppeteer.configuration.md)</span>

</td><td>

Defines options to configure Puppeteer's behavior during installation and runtime.

See individual properties for more information.

</td></tr>
<tr><td>

<span id="connectiontransport">[ConnectionTransport](./puppeteer.connectiontransport.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="connectoptions">[ConnectOptions](./puppeteer.connectoptions.md)</span>

</td><td>

Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance.

</td></tr>
<tr><td>

<span id="consolemessagelocation">[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="continuerequestoverrides">[ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="cookie">[Cookie](./puppeteer.cookie.md)</span>

</td><td>

Represents a cookie object.

</td></tr>
<tr><td>

<span id="cookiedata">[CookieData](./puppeteer.cookiedata.md)</span>

</td><td>

Cookie parameter object used to set cookies in the browser-level cookies API.

</td></tr>
<tr><td>

<span id="cookieparam">[CookieParam](./puppeteer.cookieparam.md)</span>

</td><td>

Cookie parameter object used to set cookies in the page-level cookies API.

</td></tr>
<tr><td>

<span id="cookiepartitionkey">[CookiePartitionKey](./puppeteer.cookiepartitionkey.md)</span>

</td><td>

Represents a cookie partition key in Chrome.

</td></tr>
<tr><td>

<span id="coverageentry">[CoverageEntry](./puppeteer.coverageentry.md)</span>

</td><td>

The CoverageEntry class represents one entry of the coverage report.

</td></tr>
<tr><td>

<span id="credentials">[Credentials](./puppeteer.credentials.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="csscoverageoptions">[CSSCoverageOptions](./puppeteer.csscoverageoptions.md)</span>

</td><td>

Set of configurable options for CSS coverage.

</td></tr>
<tr><td>

<span id="customqueryhandler">[CustomQueryHandler](./puppeteer.customqueryhandler.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="debuginfo">[DebugInfo](./puppeteer.debuginfo.md)</span>

</td><td>

**_(Experimental)_**

</td></tr>
<tr><td>

<span id="deletecookiesrequest">[DeleteCookiesRequest](./puppeteer.deletecookiesrequest.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="device">[Device](./puppeteer.device.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="downloadbehavior">[DownloadBehavior](./puppeteer.downloadbehavior.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="elementscreenshotoptions">[ElementScreenshotOptions](./puppeteer.elementscreenshotoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="firefoxsettings">[FirefoxSettings](./puppeteer.firefoxsettings.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="frameaddscripttagoptions">[FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="frameaddstyletagoptions">[FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="frameevents">[FrameEvents](./puppeteer.frameevents.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="framewaitforfunctionoptions">[FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="geolocationoptions">[GeolocationOptions](./puppeteer.geolocationoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="gotooptions">[GoToOptions](./puppeteer.gotooptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="interceptresolutionstate">[InterceptResolutionState](./puppeteer.interceptresolutionstate.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="internalnetworkconditions">[InternalNetworkConditions](./puppeteer.internalnetworkconditions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="jscoverageentry">[JSCoverageEntry](./puppeteer.jscoverageentry.md)</span>

</td><td>

The CoverageEntry class for JavaScript

</td></tr>
<tr><td>

<span id="jscoverageoptions">[JSCoverageOptions](./puppeteer.jscoverageoptions.md)</span>

</td><td>

Set of configurable options for JS coverage.

</td></tr>
<tr><td>

<span id="keyboardtypeoptions">[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="keydownoptions">[KeyDownOptions](./puppeteer.keydownoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="launchoptions">[LaunchOptions](./puppeteer.launchoptions.md)</span>

</td><td>

Generic launch options that can be passed when launching any browser.

</td></tr>
<tr><td>

<span id="locatorevents">[LocatorEvents](./puppeteer.locatorevents.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="locatorscrolloptions">[LocatorScrollOptions](./puppeteer.locatorscrolloptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="mediafeature">[MediaFeature](./puppeteer.mediafeature.md)</span>

</td><td>

A media feature to emulate.

</td></tr>
<tr><td>

<span id="metrics">[Metrics](./puppeteer.metrics.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="mouseclickoptions">[MouseClickOptions](./puppeteer.mouseclickoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="mousemoveoptions">[MouseMoveOptions](./puppeteer.mousemoveoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="mouseoptions">[MouseOptions](./puppeteer.mouseoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="mousewheeloptions">[MouseWheelOptions](./puppeteer.mousewheeloptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="moveable">[Moveable](./puppeteer.moveable.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="networkconditions">[NetworkConditions](./puppeteer.networkconditions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="newdocumentscriptevaluation">[NewDocumentScriptEvaluation](./puppeteer.newdocumentscriptevaluation.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="offset">[Offset](./puppeteer.offset.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="pageevents">[PageEvents](./puppeteer.pageevents.md)</span>

</td><td>

Denotes the objects received by callback functions for page events.

See [PageEvent](./puppeteer.pageevent.md) for more detail on the events and when they are emitted.

</td></tr>
<tr><td>

<span id="pdfmargin">[PDFMargin](./puppeteer.pdfmargin.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="pdfoptions">[PDFOptions](./puppeteer.pdfoptions.md)</span>

</td><td>

Valid options to configure PDF generation via [Page.pdf()](./puppeteer.page.pdf.md).

</td></tr>
<tr><td>

<span id="point">[Point](./puppeteer.point.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="queryoptions">[QueryOptions](./puppeteer.queryoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="remoteaddress">[RemoteAddress](./puppeteer.remoteaddress.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="responseforrequest">[ResponseForRequest](./puppeteer.responseforrequest.md)</span>

</td><td>

Required response data to fulfill a request with.

</td></tr>
<tr><td>

<span id="screencastoptions">[ScreencastOptions](./puppeteer.screencastoptions.md)</span>

</td><td>

**_(Experimental)_**

</td></tr>
<tr><td>

<span id="screenshotclip">[ScreenshotClip](./puppeteer.screenshotclip.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="screenshotoptions">[ScreenshotOptions](./puppeteer.screenshotoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="serializedaxnode">[SerializedAXNode](./puppeteer.serializedaxnode.md)</span>

</td><td>

Represents a Node and the properties of it that are relevant to Accessibility.

</td></tr>
<tr><td>

<span id="snapshotoptions">[SnapshotOptions](./puppeteer.snapshotoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="supportedwebdrivercapabilities">[SupportedWebDriverCapabilities](./puppeteer.supportedwebdrivercapabilities.md)</span>

</td><td>

WebDriver BiDi capabilities that are not set by Puppeteer itself.

</td></tr>
<tr><td>

<span id="touchhandle">[TouchHandle](./puppeteer.touchhandle.md)</span>

</td><td>

The TouchHandle interface exposes methods to manipulate touches that have been started

</td></tr>
<tr><td>

<span id="tracingoptions">[TracingOptions](./puppeteer.tracingoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="viewport">[Viewport](./puppeteer.viewport.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="waitfornetworkidleoptions">[WaitForNetworkIdleOptions](./puppeteer.waitfornetworkidleoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="waitforoptions">[WaitForOptions](./puppeteer.waitforoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="waitforselectoroptions">[WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="waitfortargetoptions">[WaitForTargetOptions](./puppeteer.waitfortargetoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="waittimeoutoptions">[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)</span>

</td><td>

</td></tr>
</tbody></table>

## Namespaces

<table><thead><tr><th>

Namespace

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="cdpsessionevent">[CDPSessionEvent](./puppeteer.cdpsessionevent.md)</span>

</td><td>

Events that the CDPSession class emits.

</td></tr>
</tbody></table>

## Variables

<table><thead><tr><th>

Variable

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="default_intercept_resolution_priority">[DEFAULT_INTERCEPT_RESOLUTION_PRIORITY](./puppeteer.default_intercept_resolution_priority.md)</span>

</td><td>

The default cooperative request interception resolution priority

</td></tr>
<tr><td>

<span id="executablepath">[executablePath](./puppeteer.executablepath.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="knowndevices">[KnownDevices](./puppeteer.knowndevices.md)</span>

</td><td>

A list of devices to be used with [Page.emulate()](./puppeteer.page.emulate.md).

</td></tr>
<tr><td>

<span id="mousebutton">[MouseButton](./puppeteer.mousebutton.md)</span>

</td><td>

Enum of valid mouse buttons.

</td></tr>
<tr><td>

<span id="predefinednetworkconditions">[PredefinedNetworkConditions](./puppeteer.predefinednetworkconditions.md)</span>

</td><td>

A list of pre-defined network conditions to be used with [Page.emulateNetworkConditions()](./puppeteer.page.emulatenetworkconditions.md).

</td></tr>
<tr><td>

<span id="puppeteer">[puppeteer](./puppeteer.puppeteer.md)</span>

</td><td>

</td></tr>
</tbody></table>

## Type Aliases

<table><thead><tr><th>

Type Alias

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="actionresult">[ActionResult](./puppeteer.actionresult.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="awaitable">[Awaitable](./puppeteer.awaitable.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="awaitableiterable">[AwaitableIterable](./puppeteer.awaitableiterable.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="awaitablepredicate">[AwaitablePredicate](./puppeteer.awaitablepredicate.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="awaitedlocator">[AwaitedLocator](./puppeteer.awaitedlocator.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="cdpevents">[CDPEvents](./puppeteer.cdpevents.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="chromereleasechannel">[ChromeReleaseChannel](./puppeteer.chromereleasechannel.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="consolemessagetype">[ConsoleMessageType](./puppeteer.consolemessagetype.md)</span>

</td><td>

The supported types for console messages.

</td></tr>
<tr><td>

<span id="cookiepriority">[CookiePriority](./puppeteer.cookiepriority.md)</span>

</td><td>

Represents the cookie's 'Priority' status: https://tools.ietf.org/html/draft-west-cookie-priority-00

</td></tr>
<tr><td>

<span id="cookiesamesite">[CookieSameSite](./puppeteer.cookiesamesite.md)</span>

</td><td>

Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies

</td></tr>
<tr><td>

<span id="cookiesourcescheme">[CookieSourceScheme](./puppeteer.cookiesourcescheme.md)</span>

</td><td>

Represents the source scheme of the origin that originally set the cookie. A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. This is a temporary ability and it will be removed in the future.

</td></tr>
<tr><td>

<span id="downloadpolicy">[DownloadPolicy](./puppeteer.downloadpolicy.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="elementfor">[ElementFor](./puppeteer.elementfor.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="errorcode">[ErrorCode](./puppeteer.errorcode.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="evaluatefunc">[EvaluateFunc](./puppeteer.evaluatefunc.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="evaluatefuncwith">[EvaluateFuncWith](./puppeteer.evaluatefuncwith.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="eventswithwildcard">[EventsWithWildcard](./puppeteer.eventswithwildcard.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="eventtype">[EventType](./puppeteer.eventtype.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="experimentsconfiguration">[ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md)</span>

</td><td>

Defines experiment options for Puppeteer.

See individual properties for more information.

</td></tr>
<tr><td>

<span id="flattenhandle">[FlattenHandle](./puppeteer.flattenhandle.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="handlefor">[HandleFor](./puppeteer.handlefor.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="handleor">[HandleOr](./puppeteer.handleor.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="handler">[Handler](./puppeteer.handler.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="imageformat">[ImageFormat](./puppeteer.imageformat.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="innerparams">[InnerParams](./puppeteer.innerparams.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="keyinput">[KeyInput](./puppeteer.keyinput.md)</span>

</td><td>

All the valid keys that can be passed to functions that take user input, such as [keyboard.press](./puppeteer.keyboard.press.md)

</td></tr>
<tr><td>

<span id="keypressoptions">[KeyPressOptions](./puppeteer.keypressoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="locatorclickoptions">[LocatorClickOptions](./puppeteer.locatorclickoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="lowercasepaperformat">[LowerCasePaperFormat](./puppeteer.lowercasepaperformat.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="mapper">[Mapper](./puppeteer.mapper.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="mousebutton">[MouseButton](./puppeteer.mousebutton.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="nodefor">[NodeFor](./puppeteer.nodefor.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="paperformat">[PaperFormat](./puppeteer.paperformat.md)</span>

</td><td>

All the valid paper format types when printing a PDF.

**Remarks:**

The sizes of each format are as follows:

- `Letter`: 8.5in x 11in / 21.59cm x 27.94cm

- `Legal`: 8.5in x 14in / 21.59cm x 35.56cm

- `Tabloid`: 11in x 17in / 27.94cm x 43.18cm

- `Ledger`: 17in x 11in / 43.18cm x 27.94cm

- `A0`: 33.1102in x 46.811in / 84.1cm x 118.9cm

- `A1`: 23.3858in x 33.1102in / 59.4cm x 84.1cm

- `A2`: 16.5354in x 23.3858in / 42cm x 59.4cm

- `A3`: 11.6929in x 16.5354in / 29.7cm x 42cm

- `A4`: 8.2677in x 11.6929in / 21cm x 29.7cm

- `A5`: 5.8268in x 8.2677in / 14.8cm x 21cm

- `A6`: 4.1339in x 5.8268in / 10.5cm x 14.8cm

</td></tr>
<tr><td>

<span id="permission">[Permission](./puppeteer.permission.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="predicate">[Predicate](./puppeteer.predicate.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="protocollifecycleevent">[ProtocolLifeCycleEvent](./puppeteer.protocollifecycleevent.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="protocoltype">[ProtocolType](./puppeteer.protocoltype.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="puppeteerlifecycleevent">[PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="quad">[Quad](./puppeteer.quad.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="resourcetype">[ResourceType](./puppeteer.resourcetype.md)</span>

</td><td>

Resource types for HTTPRequests as perceived by the rendering engine.

</td></tr>
<tr><td>

<span id="supportedbrowser">[SupportedBrowser](./puppeteer.supportedbrowser.md)</span>

</td><td>

Browsers supported by Puppeteer.

</td></tr>
<tr><td>

<span id="supportedwebdrivercapability">[SupportedWebDriverCapability](./puppeteer.supportedwebdrivercapability.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="targetfiltercallback">[TargetFilterCallback](./puppeteer.targetfiltercallback.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="videoformat">[VideoFormat](./puppeteer.videoformat.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="visibilityoption">[VisibilityOption](./puppeteer.visibilityoption.md)</span>

</td><td>

Whether to wait for the element to be [visible](./puppeteer.elementhandle.isvisible.md) or [hidden](./puppeteer.elementhandle.ishidden.md). `null` to disable visibility checks.

</td></tr>
</tbody></table>

    ---
sidebar_label: Accessibility
---

# Accessibility class

The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access).

### Signature

```typescript
export declare class Accessibility
```

## Remarks

Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output.

Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree.

Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="snapshot">[snapshot(options)](./puppeteer.accessibility.snapshot.md)</span>

</td><td>

</td><td>

Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.

**Remarks:**

**NOTE** The Chrome accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.

</td></tr>
</tbody></table>

    ---
sidebar_label: Accessibility.snapshot
---

# Accessibility.snapshot() method

Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.

### Signature

```typescript
class Accessibility {
  snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[SnapshotOptions](./puppeteer.snapshotoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[SerializedAXNode](./puppeteer.serializedaxnode.md) \| null&gt;

An AXNode object representing the snapshot.

## Remarks

**NOTE** The Chrome accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.

## Example 1

An example of dumping the entire accessibility tree:

```ts
const snapshot = await page.accessibility.snapshot();
console.log(snapshot);
```

## Example 2

An example of logging the focused node's name:

```ts
const snapshot = await page.accessibility.snapshot();
const node = findFocusedNode(snapshot);
console.log(node && node.name);

function findFocusedNode(node) {
  if (node.focused) return node;
  for (const child of node.children || []) {
    const foundNode = findFocusedNode(child);
    return foundNode;
  }
  return null;
}
```

    ---
sidebar_label: ActionOptions
---

# ActionOptions interface

### Signature

```typescript
export interface ActionOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="signal">signal</span>

</td><td>

`optional`

</td><td>

AbortSignal

</td><td>

A signal to abort the locator action.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ActionResult
---

# ActionResult type

### Signature

```typescript
export type ActionResult = 'continue' | 'abort' | 'respond';
```

    ---
sidebar_label: AutofillData
---

# AutofillData interface

### Signature

```typescript
export interface AutofillData
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="creditcard">creditCard</span>

</td><td>

</td><td>

&#123; number: string; name: string; expiryMonth: string; expiryYear: string; cvc: string; &#125;

</td><td>

See [Autofill.CreditCard](https://chromedevtools.github.io/devtools-protocol/tot/Autofill/#type-CreditCard).

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Awaitable
---

# Awaitable type

### Signature

```typescript
export type Awaitable<T> = T | PromiseLike<T>;
```

    ---
sidebar_label: AwaitableIterable
---

# AwaitableIterable type

### Signature

```typescript
export type AwaitableIterable<T> = Iterable<T> | AsyncIterable<T>;
```

    ---
sidebar_label: AwaitablePredicate
---

# AwaitablePredicate type

### Signature

```typescript
export type AwaitablePredicate<T> = (value: T) => Awaitable<boolean>;
```

**References:** [Awaitable](./puppeteer.awaitable.md)

    ---
sidebar_label: AwaitedLocator
---

# AwaitedLocator type

### Signature

```typescript
export type AwaitedLocator<T> = T extends Locator<infer S> ? S : never;
```

**References:** [Locator](./puppeteer.locator.md)

    ---
sidebar_label: BoundingBox
---

# BoundingBox interface

### Signature

```typescript
export interface BoundingBox extends Point
```

**Extends:** [Point](./puppeteer.point.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="height">height</span>

</td><td>

</td><td>

number

</td><td>

the height of the element in pixels.

</td><td>

</td></tr>
<tr><td>

<span id="width">width</span>

</td><td>

</td><td>

number

</td><td>

the width of the element in pixels.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: BoxModel
---

# BoxModel interface

### Signature

```typescript
export interface BoxModel
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="border">border</span>

</td><td>

</td><td>

[Quad](./puppeteer.quad.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="content">content</span>

</td><td>

</td><td>

[Quad](./puppeteer.quad.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="height">height</span>

</td><td>

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="margin">margin</span>

</td><td>

</td><td>

[Quad](./puppeteer.quad.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="padding">padding</span>

</td><td>

</td><td>

[Quad](./puppeteer.quad.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="width">width</span>

</td><td>

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Browser.browserContexts
---

# Browser.browserContexts() method

Gets a list of open [browser contexts](./puppeteer.browsercontext.md).

In a newly-created [browser](./puppeteer.browser.md), this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  abstract browserContexts(): BrowserContext[];
}
```

**Returns:**

[BrowserContext](./puppeteer.browsercontext.md)\[\]

    ---
sidebar_label: Browser.close
---

# Browser.close() method

Closes this [browser](./puppeteer.browser.md) and all associated [pages](./puppeteer.page.md).

### Signature

```typescript
class Browser {
  abstract close(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Browser.cookies
---

# Browser.cookies() method

Returns all cookies in the default [BrowserContext](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  cookies(): Promise<Cookie[]>;
}
```

**Returns:**

Promise&lt;[Cookie](./puppeteer.cookie.md)\[\]&gt;

## Remarks

Shortcut for [browser.defaultBrowserContext().cookies()](./puppeteer.browsercontext.cookies.md).

    ---
sidebar_label: Browser.createBrowserContext
---

# Browser.createBrowserContext() method

Creates a new [browser context](./puppeteer.browsercontext.md).

This won't share cookies/cache with other [browser contexts](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  abstract createBrowserContext(
    options?: BrowserContextOptions,
  ): Promise<BrowserContext>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[BrowserContextOptions](./puppeteer.browsercontextoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[BrowserContext](./puppeteer.browsercontext.md)&gt;

## Example

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
// Create a new browser context.
const context = await browser.createBrowserContext();
// Create a new page in a pristine context.
const page = await context.newPage();
// Do stuff
await page.goto('https://example.com');
```

    ---
sidebar_label: Browser.defaultBrowserContext
---

# Browser.defaultBrowserContext() method

Gets the default [browser context](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  abstract defaultBrowserContext(): BrowserContext;
}
```

**Returns:**

[BrowserContext](./puppeteer.browsercontext.md)

## Remarks

The default [browser context](./puppeteer.browsercontext.md) cannot be closed.

    ---
sidebar_label: Browser.deleteCookie
---

# Browser.deleteCookie() method

Removes cookies from the default [BrowserContext](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  deleteCookie(...cookies: Cookie[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

cookies

</td><td>

[Cookie](./puppeteer.cookie.md)\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Shortcut for [browser.defaultBrowserContext().deleteCookie()](./puppeteer.browsercontext.deletecookie.md).

    ---
sidebar_label: Browser.disconnect
---

# Browser.disconnect() method

Disconnects Puppeteer from this [browser](./puppeteer.browser.md), but leaves the process running.

### Signature

```typescript
class Browser {
  abstract disconnect(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Browser.installExtension
---

# Browser.installExtension() method

Installs an extension and returns the ID. In Chrome, this is only available if the browser was created using `pipe: true` and the `--enable-unsafe-extension-debugging` flag is set.

### Signature

```typescript
class Browser {
  abstract installExtension(path: string): Promise<string>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

path

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: Browser.isConnected
---

# Browser.isConnected() method

> Warning: This API is now obsolete.
>
> Use [Browser.connected](./puppeteer.browser.md).

Whether Puppeteer is connected to this [browser](./puppeteer.browser.md).

### Signature

```typescript
class Browser {
  isConnected(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: Browser
---

# Browser class

[Browser](./puppeteer.browser.md) represents a browser instance that is either:

- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md).

[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.emit.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.

### Signature

```typescript
export declare abstract class Browser extends EventEmitter<BrowserEvents>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[BrowserEvents](./puppeteer.browserevents.md)&gt;

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Browser` class.

## Example 1

Using a [Browser](./puppeteer.browser.md) to create a [Page](./puppeteer.page.md):

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await browser.close();
```

## Example 2

Disconnecting from and reconnecting to a [Browser](./puppeteer.browser.md):

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
// Store the endpoint to be able to reconnect to the browser.
const browserWSEndpoint = browser.wsEndpoint();
// Disconnect puppeteer from the browser.
await browser.disconnect();

// Use the endpoint to reestablish a connection
const browser2 = await puppeteer.connect({browserWSEndpoint});
// Close the browser.
await browser2.close();
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="connected">connected</span>

</td><td>

`readonly`

</td><td>

boolean

</td><td>

Whether Puppeteer is connected to this [browser](./puppeteer.browser.md).

</td></tr>
<tr><td>

<span id="debuginfo">debugInfo</span>

</td><td>

`readonly`

</td><td>

[DebugInfo](./puppeteer.debuginfo.md)

</td><td>

**_(Experimental)_** Get debug information from Puppeteer.

**Remarks:**

Currently, includes pending protocol calls. In the future, we might add more info.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="browsercontexts">[browserContexts()](./puppeteer.browser.browsercontexts.md)</span>

</td><td>

</td><td>

Gets a list of open [browser contexts](./puppeteer.browsercontext.md).

In a newly-created [browser](./puppeteer.browser.md), this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="close">[close()](./puppeteer.browser.close.md)</span>

</td><td>

</td><td>

Closes this [browser](./puppeteer.browser.md) and all associated [pages](./puppeteer.page.md).

</td></tr>
<tr><td>

<span id="cookies">[cookies()](./puppeteer.browser.cookies.md)</span>

</td><td>

</td><td>

Returns all cookies in the default [BrowserContext](./puppeteer.browsercontext.md).

**Remarks:**

Shortcut for [browser.defaultBrowserContext().cookies()](./puppeteer.browsercontext.cookies.md).

</td></tr>
<tr><td>

<span id="createbrowsercontext">[createBrowserContext(options)](./puppeteer.browser.createbrowsercontext.md)</span>

</td><td>

</td><td>

Creates a new [browser context](./puppeteer.browsercontext.md).

This won't share cookies/cache with other [browser contexts](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="defaultbrowsercontext">[defaultBrowserContext()](./puppeteer.browser.defaultbrowsercontext.md)</span>

</td><td>

</td><td>

Gets the default [browser context](./puppeteer.browsercontext.md).

**Remarks:**

The default [browser context](./puppeteer.browsercontext.md) cannot be closed.

</td></tr>
<tr><td>

<span id="deletecookie">[deleteCookie(cookies)](./puppeteer.browser.deletecookie.md)</span>

</td><td>

</td><td>

Removes cookies from the default [BrowserContext](./puppeteer.browsercontext.md).

**Remarks:**

Shortcut for [browser.defaultBrowserContext().deleteCookie()](./puppeteer.browsercontext.deletecookie.md).

</td></tr>
<tr><td>

<span id="disconnect">[disconnect()](./puppeteer.browser.disconnect.md)</span>

</td><td>

</td><td>

Disconnects Puppeteer from this [browser](./puppeteer.browser.md), but leaves the process running.

</td></tr>
<tr><td>

<span id="installextension">[installExtension(path)](./puppeteer.browser.installextension.md)</span>

</td><td>

</td><td>

Installs an extension and returns the ID. In Chrome, this is only available if the browser was created using `pipe: true` and the `--enable-unsafe-extension-debugging` flag is set.

</td></tr>
<tr><td>

<span id="isconnected">[isConnected()](./puppeteer.browser.isconnected.md)</span>

</td><td>

`deprecated`

</td><td>

Whether Puppeteer is connected to this [browser](./puppeteer.browser.md).

**Deprecated:**

Use [Browser.connected](./puppeteer.browser.md).

</td></tr>
<tr><td>

<span id="newpage">[newPage()](./puppeteer.browser.newpage.md)</span>

</td><td>

</td><td>

Creates a new [page](./puppeteer.page.md) in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md).

</td></tr>
<tr><td>

<span id="pages">[pages()](./puppeteer.browser.pages.md)</span>

</td><td>

</td><td>

Gets a list of all open [pages](./puppeteer.page.md) inside this [Browser](./puppeteer.browser.md).

If there are multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [pages](./puppeteer.page.md) in all [browser contexts](./puppeteer.browsercontext.md).

**Remarks:**

Non-visible [pages](./puppeteer.page.md), such as `"background_page"`, will not be listed here. You can find them using [Target.page()](./puppeteer.target.page.md).

</td></tr>
<tr><td>

<span id="process">[process()](./puppeteer.browser.process.md)</span>

</td><td>

</td><td>

Gets the associated [ChildProcess](https://nodejs.org/api/child_process.html#class-childprocess).

</td></tr>
<tr><td>

<span id="setcookie">[setCookie(cookies)](./puppeteer.browser.setcookie.md)</span>

</td><td>

</td><td>

Sets cookies in the default [BrowserContext](./puppeteer.browsercontext.md).

**Remarks:**

Shortcut for [browser.defaultBrowserContext().setCookie()](./puppeteer.browsercontext.setcookie.md).

</td></tr>
<tr><td>

<span id="target">[target()](./puppeteer.browser.target.md)</span>

</td><td>

</td><td>

Gets the [target](./puppeteer.target.md) associated with the [default browser context](./puppeteer.browser.defaultbrowsercontext.md)).

</td></tr>
<tr><td>

<span id="targets">[targets()](./puppeteer.browser.targets.md)</span>

</td><td>

</td><td>

Gets all active [targets](./puppeteer.target.md).

In case of multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [targets](./puppeteer.target.md) in all [browser contexts](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="uninstallextension">[uninstallExtension(id)](./puppeteer.browser.uninstallextension.md)</span>

</td><td>

</td><td>

Uninstalls an extension. In Chrome, this is only available if the browser was created using `pipe: true` and the `--enable-unsafe-extension-debugging` flag is set.

</td></tr>
<tr><td>

<span id="useragent">[userAgent()](./puppeteer.browser.useragent.md)</span>

</td><td>

</td><td>

Gets this [browser's](./puppeteer.browser.md) original user agent.

[Pages](./puppeteer.page.md) can override the user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).

</td></tr>
<tr><td>

<span id="version">[version()](./puppeteer.browser.version.md)</span>

</td><td>

</td><td>

Gets a string representing this [browser's](./puppeteer.browser.md) name and version.

For headless browser, this is similar to `"HeadlessChrome/61.0.3153.0"`. For non-headless or new-headless, this is similar to `"Chrome/61.0.3153.0"`. For Firefox, it is similar to `"Firefox/116.0a1"`.

The format of [Browser.version()](./puppeteer.browser.version.md) might change with future releases of browsers.

</td></tr>
<tr><td>

<span id="waitfortarget">[waitForTarget(predicate, options)](./puppeteer.browser.waitfortarget.md)</span>

</td><td>

</td><td>

Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it.

This will look all open [browser contexts](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="wsendpoint">[wsEndpoint()](./puppeteer.browser.wsendpoint.md)</span>

</td><td>

</td><td>

Gets the WebSocket URL to connect to this [browser](./puppeteer.browser.md).

This is usually used with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).

You can find the debugger URL (`webSocketDebuggerUrl`) from `http://HOST:PORT/json/version`.

See [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target) for more information.

**Remarks:**

The format is always `ws://HOST:PORT/devtools/browser/<id>`.

</td></tr>
</tbody></table>

    ---
sidebar_label: Browser.newPage
---

# Browser.newPage() method

Creates a new [page](./puppeteer.page.md) in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md).

### Signature

```typescript
class Browser {
  abstract newPage(): Promise<Page>;
}
```

**Returns:**

Promise&lt;[Page](./puppeteer.page.md)&gt;

    ---
sidebar_label: Browser.pages
---

# Browser.pages() method

Gets a list of all open [pages](./puppeteer.page.md) inside this [Browser](./puppeteer.browser.md).

If there are multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [pages](./puppeteer.page.md) in all [browser contexts](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  pages(): Promise<Page[]>;
}
```

**Returns:**

Promise&lt;[Page](./puppeteer.page.md)\[\]&gt;

## Remarks

Non-visible [pages](./puppeteer.page.md), such as `"background_page"`, will not be listed here. You can find them using [Target.page()](./puppeteer.target.page.md).

    ---
sidebar_label: Browser.process
---

# Browser.process() method

Gets the associated [ChildProcess](https://nodejs.org/api/child_process.html#class-childprocess).

### Signature

```typescript
class Browser {
  abstract process(): ChildProcess | null;
}
```

**Returns:**

ChildProcess \| null

`null` if this instance was connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).

    ---
sidebar_label: Browser.setCookie
---

# Browser.setCookie() method

Sets cookies in the default [BrowserContext](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  setCookie(...cookies: CookieData[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

cookies

</td><td>

[CookieData](./puppeteer.cookiedata.md)\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Shortcut for [browser.defaultBrowserContext().setCookie()](./puppeteer.browsercontext.setcookie.md).

    ---
sidebar_label: Browser.target
---

# Browser.target() method

Gets the [target](./puppeteer.target.md) associated with the [default browser context](./puppeteer.browser.defaultbrowsercontext.md)).

### Signature

```typescript
class Browser {
  abstract target(): Target;
}
```

**Returns:**

[Target](./puppeteer.target.md)

    ---
sidebar_label: Browser.targets
---

# Browser.targets() method

Gets all active [targets](./puppeteer.target.md).

In case of multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [targets](./puppeteer.target.md) in all [browser contexts](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  abstract targets(): Target[];
}
```

**Returns:**

[Target](./puppeteer.target.md)\[\]

    ---
sidebar_label: Browser.uninstallExtension
---

# Browser.uninstallExtension() method

Uninstalls an extension. In Chrome, this is only available if the browser was created using `pipe: true` and the `--enable-unsafe-extension-debugging` flag is set.

### Signature

```typescript
class Browser {
  abstract uninstallExtension(id: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

id

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Browser.userAgent
---

# Browser.userAgent() method

Gets this [browser's](./puppeteer.browser.md) original user agent.

[Pages](./puppeteer.page.md) can override the user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).

### Signature

```typescript
class Browser {
  abstract userAgent(): Promise<string>;
}
```

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: Browser.version
---

# Browser.version() method

Gets a string representing this [browser's](./puppeteer.browser.md) name and version.

For headless browser, this is similar to `"HeadlessChrome/61.0.3153.0"`. For non-headless or new-headless, this is similar to `"Chrome/61.0.3153.0"`. For Firefox, it is similar to `"Firefox/116.0a1"`.

The format of [Browser.version()](./puppeteer.browser.version.md) might change with future releases of browsers.

### Signature

```typescript
class Browser {
  abstract version(): Promise<string>;
}
```

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: Browser.waitForTarget
---

# Browser.waitForTarget() method

Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it.

This will look all open [browser contexts](./puppeteer.browsercontext.md).

### Signature

```typescript
class Browser {
  waitForTarget(
    predicate: (x: Target) => boolean | Promise<boolean>,
    options?: WaitForTargetOptions,
  ): Promise<Target>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

predicate

</td><td>

(x: [Target](./puppeteer.target.md)) =&gt; boolean \| Promise&lt;boolean&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

[WaitForTargetOptions](./puppeteer.waitfortargetoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Target](./puppeteer.target.md)&gt;

## Example

Finding a target for a page opened via `window.open`:

```ts
await page.evaluate(() => window.open('https://www.example.com/'));
const newWindowTarget = await browser.waitForTarget(
  target => target.url() === 'https://www.example.com/',
);
```

    ---
sidebar_label: Browser.wsEndpoint
---

# Browser.wsEndpoint() method

Gets the WebSocket URL to connect to this [browser](./puppeteer.browser.md).

This is usually used with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).

You can find the debugger URL (`webSocketDebuggerUrl`) from `http://HOST:PORT/json/version`.

See [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target) for more information.

### Signature

```typescript
class Browser {
  abstract wsEndpoint(): string;
}
```

**Returns:**

string

## Remarks

The format is always `ws://HOST:PORT/devtools/browser/<id>`.

    ---
sidebar_label: BrowserContext.browser
---

# BrowserContext.browser() method

Gets the [browser](./puppeteer.browser.md) associated with this [browser context](./puppeteer.browsercontext.md).

### Signature

```typescript
class BrowserContext {
  abstract browser(): Browser;
}
```

**Returns:**

[Browser](./puppeteer.browser.md)

    ---
sidebar_label: BrowserContext.clearPermissionOverrides
---

# BrowserContext.clearPermissionOverrides() method

Clears all permission overrides for this [browser context](./puppeteer.browsercontext.md).

### Signature

```typescript
class BrowserContext {
  abstract clearPermissionOverrides(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

## Example

Clearing overridden permissions in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md):

```ts
const context = browser.defaultBrowserContext();
context.overridePermissions('https://example.com', ['clipboard-read']);
// do stuff ..
context.clearPermissionOverrides();
```

    ---
sidebar_label: BrowserContext.close
---

# BrowserContext.close() method

Closes this [browser context](./puppeteer.browsercontext.md) and all associated [pages](./puppeteer.page.md).

### Signature

```typescript
class BrowserContext {
  abstract close(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

## Remarks

The [default browser context](./puppeteer.browser.defaultbrowsercontext.md) cannot be closed.

    ---
sidebar_label: BrowserContext.cookies
---

# BrowserContext.cookies() method

Gets all cookies in the browser context.

### Signature

```typescript
class BrowserContext {
  abstract cookies(): Promise<Cookie[]>;
}
```

**Returns:**

Promise&lt;[Cookie](./puppeteer.cookie.md)\[\]&gt;

    ---
sidebar_label: BrowserContext.deleteCookie
---

# BrowserContext.deleteCookie() method

Removes cookie in the browser context

### Signature

```typescript
class BrowserContext {
  deleteCookie(...cookies: Cookie[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

cookies

</td><td>

[Cookie](./puppeteer.cookie.md)\[\]

</td><td>

[cookie](./puppeteer.cookie.md) to remove

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: BrowserContext
---

# BrowserContext class

[BrowserContext](./puppeteer.browsercontext.md) represents individual user contexts within a [browser](./puppeteer.browser.md).

When a [browser](./puppeteer.browser.md) is launched, it has at least one default [browser context](./puppeteer.browsercontext.md). Others can be created using [Browser.createBrowserContext()](./puppeteer.browser.createbrowsercontext.md). Each context has isolated storage (cookies/localStorage/etc.)

[BrowserContext](./puppeteer.browsercontext.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserContextEvent](./puppeteer.browsercontextevent.md) enum.

If a [page](./puppeteer.page.md) opens another [page](./puppeteer.page.md), e.g. using `window.open`, the popup will belong to the parent [page's browser context](./puppeteer.page.browsercontext.md).

### Signature

```typescript
export declare abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[BrowserContextEvents](./puppeteer.browsercontextevents.md)&gt;

## Remarks

In Chrome all non-default contexts are incognito, and [default browser context](./puppeteer.browser.defaultbrowsercontext.md) might be incognito if you provide the `--incognito` argument when launching the browser.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserContext` class.

## Example

Creating a new [browser context](./puppeteer.browsercontext.md):

```ts
// Create a new browser context
const context = await browser.createBrowserContext();
// Create a new page inside context.
const page = await context.newPage();
// ... do stuff with page ...
await page.goto('https://example.com');
// Dispose context once it's no longer needed.
await context.close();
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="closed">closed</span>

</td><td>

`readonly`

</td><td>

boolean

</td><td>

Whether this [browser context](./puppeteer.browsercontext.md) is closed.

</td></tr>
<tr><td>

<span id="id">id</span>

</td><td>

`readonly`

</td><td>

string \| undefined

</td><td>

Identifier for this [browser context](./puppeteer.browsercontext.md).

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="browser">[browser()](./puppeteer.browsercontext.browser.md)</span>

</td><td>

</td><td>

Gets the [browser](./puppeteer.browser.md) associated with this [browser context](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="clearpermissionoverrides">[clearPermissionOverrides()](./puppeteer.browsercontext.clearpermissionoverrides.md)</span>

</td><td>

</td><td>

Clears all permission overrides for this [browser context](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="close">[close()](./puppeteer.browsercontext.close.md)</span>

</td><td>

</td><td>

Closes this [browser context](./puppeteer.browsercontext.md) and all associated [pages](./puppeteer.page.md).

**Remarks:**

The [default browser context](./puppeteer.browser.defaultbrowsercontext.md) cannot be closed.

</td></tr>
<tr><td>

<span id="cookies">[cookies()](./puppeteer.browsercontext.cookies.md)</span>

</td><td>

</td><td>

Gets all cookies in the browser context.

</td></tr>
<tr><td>

<span id="deletecookie">[deleteCookie(cookies)](./puppeteer.browsercontext.deletecookie.md)</span>

</td><td>

</td><td>

Removes cookie in the browser context

</td></tr>
<tr><td>

<span id="newpage">[newPage()](./puppeteer.browsercontext.newpage.md)</span>

</td><td>

</td><td>

Creates a new [page](./puppeteer.page.md) in this [browser context](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="overridepermissions">[overridePermissions(origin, permissions)](./puppeteer.browsercontext.overridepermissions.md)</span>

</td><td>

</td><td>

Grants this [browser context](./puppeteer.browsercontext.md) the given `permissions` within the given `origin`.

</td></tr>
<tr><td>

<span id="pages">[pages()](./puppeteer.browsercontext.pages.md)</span>

</td><td>

</td><td>

Gets a list of all open [pages](./puppeteer.page.md) inside this [browser context](./puppeteer.browsercontext.md).

**Remarks:**

Non-visible [pages](./puppeteer.page.md), such as `"background_page"`, will not be listed here. You can find them using [Target.page()](./puppeteer.target.page.md).

</td></tr>
<tr><td>

<span id="setcookie">[setCookie(cookies)](./puppeteer.browsercontext.setcookie.md)</span>

</td><td>

</td><td>

Sets a cookie in the browser context.

</td></tr>
<tr><td>

<span id="targets">[targets()](./puppeteer.browsercontext.targets.md)</span>

</td><td>

</td><td>

Gets all active [targets](./puppeteer.target.md) inside this [browser context](./puppeteer.browsercontext.md).

</td></tr>
<tr><td>

<span id="waitfortarget">[waitForTarget(predicate, options)](./puppeteer.browsercontext.waitfortarget.md)</span>

</td><td>

</td><td>

Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it.

This will look all open [browser contexts](./puppeteer.browsercontext.md).

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserContext.newPage
---

# BrowserContext.newPage() method

Creates a new [page](./puppeteer.page.md) in this [browser context](./puppeteer.browsercontext.md).

### Signature

```typescript
class BrowserContext {
  abstract newPage(): Promise<Page>;
}
```

**Returns:**

Promise&lt;[Page](./puppeteer.page.md)&gt;

    ---
sidebar_label: BrowserContext.overridePermissions
---

# BrowserContext.overridePermissions() method

Grants this [browser context](./puppeteer.browsercontext.md) the given `permissions` within the given `origin`.

### Signature

```typescript
class BrowserContext {
  abstract overridePermissions(
    origin: string,
    permissions: Permission[],
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

origin

</td><td>

string

</td><td>

The origin to grant permissions to, e.g. "https://example.com".

</td></tr>
<tr><td>

permissions

</td><td>

[Permission](./puppeteer.permission.md)\[\]

</td><td>

An array of permissions to grant. All permissions that are not listed here will be automatically denied.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

Overriding permissions in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md):

```ts
const context = browser.defaultBrowserContext();
await context.overridePermissions('https://html5demos.com', ['geolocation']);
```

    ---
sidebar_label: BrowserContext.pages
---

# BrowserContext.pages() method

Gets a list of all open [pages](./puppeteer.page.md) inside this [browser context](./puppeteer.browsercontext.md).

### Signature

```typescript
class BrowserContext {
  abstract pages(): Promise<Page[]>;
}
```

**Returns:**

Promise&lt;[Page](./puppeteer.page.md)\[\]&gt;

## Remarks

Non-visible [pages](./puppeteer.page.md), such as `"background_page"`, will not be listed here. You can find them using [Target.page()](./puppeteer.target.page.md).

    ---
sidebar_label: BrowserContext.setCookie
---

# BrowserContext.setCookie() method

Sets a cookie in the browser context.

### Signature

```typescript
class BrowserContext {
  abstract setCookie(...cookies: CookieData[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

cookies

</td><td>

[CookieData](./puppeteer.cookiedata.md)\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: BrowserContext.targets
---

# BrowserContext.targets() method

Gets all active [targets](./puppeteer.target.md) inside this [browser context](./puppeteer.browsercontext.md).

### Signature

```typescript
class BrowserContext {
  abstract targets(): Target[];
}
```

**Returns:**

[Target](./puppeteer.target.md)\[\]

    ---
sidebar_label: BrowserContext.waitForTarget
---

# BrowserContext.waitForTarget() method

Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it.

This will look all open [browser contexts](./puppeteer.browsercontext.md).

### Signature

```typescript
class BrowserContext {
  waitForTarget(
    predicate: (x: Target) => boolean | Promise<boolean>,
    options?: WaitForTargetOptions,
  ): Promise<Target>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

predicate

</td><td>

(x: [Target](./puppeteer.target.md)) =&gt; boolean \| Promise&lt;boolean&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

[WaitForTargetOptions](./puppeteer.waitfortargetoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Target](./puppeteer.target.md)&gt;

## Example

Finding a target for a page opened via `window.open`:

```ts
await page.evaluate(() => window.open('https://www.example.com/'));
const newWindowTarget = await browserContext.waitForTarget(
  target => target.url() === 'https://www.example.com/',
);
```

    ---
sidebar_label: BrowserContextEvent
---

# BrowserContextEvent enum

### Signature

```typescript
export declare const enum BrowserContextEvent
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

TargetChanged

</td><td>

`"targetchanged"`

</td><td>

Emitted when the url of a target inside the browser context changes. Contains a [Target](./puppeteer.target.md) instance.

</td></tr>
<tr><td>

TargetCreated

</td><td>

`"targetcreated"`

</td><td>

Emitted when a target is created within the browser context, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browserContext.newPage](./puppeteer.browsercontext.newpage.md)

Contains a [Target](./puppeteer.target.md) instance.

</td></tr>
<tr><td>

TargetDestroyed

</td><td>

`"targetdestroyed"`

</td><td>

Emitted when a target is destroyed within the browser context, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance.

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserContextEvents
---

# BrowserContextEvents interface

### Signature

```typescript
export interface BrowserContextEvents extends Record<EventType, unknown>
```

**Extends:** Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="targetchanged">targetchanged</span>

</td><td>

</td><td>

[Target](./puppeteer.target.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="targetcreated">targetcreated</span>

</td><td>

</td><td>

[Target](./puppeteer.target.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="targetdestroyed">targetdestroyed</span>

</td><td>

</td><td>

[Target](./puppeteer.target.md)

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserContextOptions
---

# BrowserContextOptions interface

### Signature

```typescript
export interface BrowserContextOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="downloadbehavior">downloadBehavior</span>

</td><td>

`optional`

</td><td>

[DownloadBehavior](./puppeteer.downloadbehavior.md)

</td><td>

Behavior definition for when downloading a file.

**Remarks:**

If not set, the default behavior will be used.

</td><td>

</td></tr>
<tr><td>

<span id="proxybypasslist">proxyBypassList</span>

</td><td>

`optional`

</td><td>

string\[\]

</td><td>

Bypass the proxy for the given list of hosts.

</td><td>

</td></tr>
<tr><td>

<span id="proxyserver">proxyServer</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Proxy server with optional port to use for all requests. Username and password can be set in `Page.authenticate`.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserEvent
---

# BrowserEvent enum

All the events a [browser instance](./puppeteer.browser.md) may emit.

### Signature

```typescript
export declare const enum BrowserEvent
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

Disconnected

</td><td>

`"disconnected"`

</td><td>

Emitted when Puppeteer gets disconnected from the browser instance. This might happen because either:

- The browser closes/crashes or - [Browser.disconnect()](./puppeteer.browser.disconnect.md) was called.

</td></tr>
<tr><td>

TargetChanged

</td><td>

`"targetchanged"`

</td><td>

Emitted when the URL of a target changes. Contains a [Target](./puppeteer.target.md) instance.

**Remarks:**

Note that this includes target changes in all browser contexts.

</td></tr>
<tr><td>

TargetCreated

</td><td>

`"targetcreated"`

</td><td>

Emitted when a target is created, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browser.newPage](./puppeteer.browser.newpage.md)

Contains a [Target](./puppeteer.target.md) instance.

**Remarks:**

Note that this includes target creations in all browser contexts.

</td></tr>
<tr><td>

TargetDestroyed

</td><td>

`"targetdestroyed"`

</td><td>

Emitted when a target is destroyed, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance.

**Remarks:**

Note that this includes target destructions in all browser contexts.

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserEvents
---

# BrowserEvents interface

### Signature

```typescript
export interface BrowserEvents extends Record<EventType, unknown>
```

**Extends:** Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="disconnected">disconnected</span>

</td><td>

</td><td>

undefined

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="targetchanged">targetchanged</span>

</td><td>

</td><td>

[Target](./puppeteer.target.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="targetcreated">targetcreated</span>

</td><td>

</td><td>

[Target](./puppeteer.target.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="targetdestroyed">targetdestroyed</span>

</td><td>

</td><td>

[Target](./puppeteer.target.md)

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserLauncher.defaultArgs
---

# BrowserLauncher.defaultArgs() method

### Signature

```typescript
class BrowserLauncher {
  abstract defaultArgs(object: LaunchOptions): string[];
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

object

</td><td>

[LaunchOptions](./puppeteer.launchoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

string\[\]

    ---
sidebar_label: BrowserLauncher.executablePath
---

# BrowserLauncher.executablePath() method

### Signature

```typescript
class BrowserLauncher {
  abstract executablePath(
    channel?: ChromeReleaseChannel,
    validatePath?: boolean,
  ): string;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

channel

</td><td>

[ChromeReleaseChannel](./puppeteer.chromereleasechannel.md)

</td><td>

_(Optional)_

</td></tr>
<tr><td>

validatePath

</td><td>

boolean

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

string

    ---
sidebar_label: BrowserLauncher.launch
---

# BrowserLauncher.launch() method

### Signature

```typescript
class BrowserLauncher {
  launch(options?: LaunchOptions): Promise<Browser>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[LaunchOptions](./puppeteer.launchoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Browser](./puppeteer.browser.md)&gt;

    ---
sidebar_label: BrowserLauncher
---

# BrowserLauncher class

Describes a launcher - a class that is able to create and launch a browser instance.

### Signature

```typescript
export declare abstract class BrowserLauncher
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserLauncher` class.

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="browser">browser</span>

</td><td>

`readonly`

</td><td>

[SupportedBrowser](./puppeteer.supportedbrowser.md)

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="defaultargs">[defaultArgs(object)](./puppeteer.browserlauncher.defaultargs.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="executablepath">[executablePath(channel, validatePath)](./puppeteer.browserlauncher.executablepath.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="launch">[launch(options)](./puppeteer.browserlauncher.launch.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CDPEvents
---

# CDPEvents type

### Signature

```typescript
export type CDPEvents = {
  [Property in keyof ProtocolMapping.Events]: ProtocolMapping.Events[Property][0];
};
```

    ---
sidebar_label: CDPSession.connection
---

# CDPSession.connection() method

The underlying connection for this session, if any.

### Signature

```typescript
class CDPSession {
  abstract connection(): Connection | undefined;
}
```

**Returns:**

[Connection](./puppeteer.connection.md) \| undefined

    ---
sidebar_label: CDPSession.detach
---

# CDPSession.detach() method

Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages.

### Signature

```typescript
class CDPSession {
  abstract detach(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: CDPSession.id
---

# CDPSession.id() method

Returns the session's id.

### Signature

```typescript
class CDPSession {
  abstract id(): string;
}
```

**Returns:**

string

    ---
sidebar_label: CDPSession
---

# CDPSession class

The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.

### Signature

```typescript
export declare abstract class CDPSession extends EventEmitter<CDPSessionEvents>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[CDPSessionEvents](./puppeteer.cdpsessionevents.md)&gt;

## Remarks

Protocol methods can be called with [CDPSession.send()](./puppeteer.cdpsession.send.md) method and protocol events can be subscribed to with `CDPSession.on` method.

Useful links: [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/) and [Getting Started with DevTools Protocol](https://github.com/aslushnikov/getting-started-with-cdp/blob/HEAD/README.md).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `CDPSession` class.

## Example

```ts
const client = await page.createCDPSession();
await client.send('Animation.enable');
client.on('Animation.animationCreated', () =>
  console.log('Animation created!'),
);
const response = await client.send('Animation.getPlaybackRate');
console.log('playback rate is ' + response.playbackRate);
await client.send('Animation.setPlaybackRate', {
  playbackRate: response.playbackRate / 2,
});
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="detached">detached</span>

</td><td>

`readonly`

</td><td>

boolean

</td><td>

True if the session has been detached, false otherwise.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="connection">[connection()](./puppeteer.cdpsession.connection.md)</span>

</td><td>

</td><td>

The underlying connection for this session, if any.

</td></tr>
<tr><td>

<span id="detach">[detach()](./puppeteer.cdpsession.detach.md)</span>

</td><td>

</td><td>

Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages.

</td></tr>
<tr><td>

<span id="id">[id()](./puppeteer.cdpsession.id.md)</span>

</td><td>

</td><td>

Returns the session's id.

</td></tr>
<tr><td>

<span id="send">[send(method, params, options)](./puppeteer.cdpsession.send.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CDPSession.send
---

# CDPSession.send() method

### Signature

```typescript
class CDPSession {
  abstract send<T extends keyof ProtocolMapping.Commands>(
    method: T,
    params?: ProtocolMapping.Commands[T]['paramsType'][0],
    options?: CommandOptions,
  ): Promise<ProtocolMapping.Commands[T]['returnType']>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

method

</td><td>

T

</td><td>

</td></tr>
<tr><td>

params

</td><td>

ProtocolMapping.Commands\[T\]\['paramsType'\]\[0\]

</td><td>

_(Optional)_

</td></tr>
<tr><td>

options

</td><td>

[CommandOptions](./puppeteer.commandoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;ProtocolMapping.Commands\[T\]\['returnType'\]&gt;

    ---
sidebar_label: CDPSessionEvent
---

# CDPSessionEvent namespace

Events that the CDPSession class emits.

### Signature

```typescript
export declare namespace CDPSessionEvent
```

## Variables

<table><thead><tr><th>

Variable

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="sessionattached">[SessionAttached](./puppeteer.cdpsessionevent.sessionattached.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="sessiondetached">[SessionDetached](./puppeteer.cdpsessionevent.sessiondetached.md)</span>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CDPSessionEvent.SessionAttached
---

# CDPSessionEvent.SessionAttached variable

### Signature

```typescript
SessionAttached: 'sessionattached';
```

    ---
sidebar_label: CDPSessionEvent.SessionDetached
---

# CDPSessionEvent.SessionDetached variable

### Signature

```typescript
SessionDetached: 'sessiondetached';
```

    ---
sidebar_label: CDPSessionEvents
---

# CDPSessionEvents interface

### Signature

```typescript
export interface CDPSessionEvents extends CDPEvents, Record<EventType, unknown>
```

**Extends:** [CDPEvents](./puppeteer.cdpevents.md), Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="sessionattached">sessionattached</span>

</td><td>

</td><td>

[CDPSession](./puppeteer.cdpsession.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="sessiondetached">sessiondetached</span>

</td><td>

</td><td>

[CDPSession](./puppeteer.cdpsession.md)

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ChromeHeadlessShellSettings
---

# ChromeHeadlessShellSettings interface

### Signature

```typescript
export interface ChromeHeadlessShellSettings
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="downloadbaseurl">downloadBaseUrl</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Specifies the URL prefix that is used to download the browser.

Can be overridden by `PUPPETEER_CHROME_HEADLESS_SHELL_DOWNLOAD_BASE_URL`.

**Remarks:**

This must include the protocol and may even need a path prefix. This must **not** include a trailing slash similar to the default.

</td><td>

https://storage.googleapis.com/chrome-for-testing-public

</td></tr>
<tr><td>

<span id="skipdownload">skipDownload</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Tells Puppeteer to not download the browser during installation.

Can be overridden by `PUPPETEER_CHROME_HEADLESS_SHELL_SKIP_DOWNLOAD` or `PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD`.

</td><td>

false

</td></tr>
<tr><td>

<span id="version">version</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Specifies a certain version of the browser you'd like Puppeteer to use.

Can be overridden by `PUPPETEER_CHROME_HEADLESS_SHELL_VERSION`.

See [puppeteer.launch](./puppeteer.puppeteernode.launch.md) on how executable path is inferred.

</td><td>

The pinned browser version supported by the current Puppeteer version.

</td></tr>
</tbody></table>

    ---
sidebar_label: ChromeReleaseChannel
---

# ChromeReleaseChannel type

### Signature

```typescript
export type ChromeReleaseChannel =
  | 'chrome'
  | 'chrome-beta'
  | 'chrome-canary'
  | 'chrome-dev';
```

    ---
sidebar_label: ChromeSettings
---

# ChromeSettings interface

### Signature

```typescript
export interface ChromeSettings
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="downloadbaseurl">downloadBaseUrl</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Specifies the URL prefix that is used to download the browser.

Can be overridden by `PUPPETEER_CHROME_DOWNLOAD_BASE_URL`.

**Remarks:**

This must include the protocol and may even need a path prefix. This must **not** include a trailing slash similar to the default.

</td><td>

https://storage.googleapis.com/chrome-for-testing-public

</td></tr>
<tr><td>

<span id="skipdownload">skipDownload</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Tells Puppeteer to not download the browser during installation.

Can be overridden by `PUPPETEER_CHROME_SKIP_DOWNLOAD`.

</td><td>

false

</td></tr>
<tr><td>

<span id="version">version</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Specifies a certain version of the browser you'd like Puppeteer to use.

Can be overridden by `PUPPETEER_CHROME_VERSION` or `PUPPETEER_SKIP_CHROME_DOWNLOAD`.

See [puppeteer.launch](./puppeteer.puppeteernode.launch.md) on how executable path is inferred.

</td><td>

The pinned browser version supported by the current Puppeteer version.

</td></tr>
</tbody></table>

    ---
sidebar_label: ClickOptions
---

# ClickOptions interface

### Signature

```typescript
export interface ClickOptions extends MouseClickOptions
```

**Extends:** [MouseClickOptions](./puppeteer.mouseclickoptions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="debughighlight">debugHighlight</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

**_(Experimental)_** An experimental debugging feature. If true, inserts an element into the page to highlight the click location for 10 seconds. Might not work on all pages and does not persist across navigations.

</td><td>

</td></tr>
<tr><td>

<span id="offset">offset</span>

</td><td>

`optional`

</td><td>

[Offset](./puppeteer.offset.md)

</td><td>

Offset for the clickable point relative to the top-left corner of the border box.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CommandOptions
---

# CommandOptions interface

### Signature

```typescript
export interface CommandOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="timeout">timeout</span>

</td><td>

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CommonEventEmitter.emit
---

# CommonEventEmitter.emit() method

### Signature

```typescript
interface CommonEventEmitter {
  emit<Key extends keyof Events>(type: Key, event: Events[Key]): boolean;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

</td></tr>
<tr><td>

event

</td><td>

Events\[Key\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

boolean

    ---
sidebar_label: CommonEventEmitter.listenerCount
---

# CommonEventEmitter.listenerCount() method

### Signature

```typescript
interface CommonEventEmitter {
  listenerCount(event: keyof Events): number;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

event

</td><td>

keyof Events

</td><td>

</td></tr>
</tbody></table>

**Returns:**

number

    ---
sidebar_label: CommonEventEmitter
---

# CommonEventEmitter interface

### Signature

```typescript
export interface CommonEventEmitter<Events extends Record<EventType, unknown>>
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="emit">[emit(type, event)](./puppeteer.commoneventemitter.emit.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="listenercount">[listenerCount(event)](./puppeteer.commoneventemitter.listenercount.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="off">[off(type, handler)](./puppeteer.commoneventemitter.off.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="on">[on(type, handler)](./puppeteer.commoneventemitter.on.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="once">[once(type, handler)](./puppeteer.commoneventemitter.once.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="removealllisteners">[removeAllListeners(event)](./puppeteer.commoneventemitter.removealllisteners.md)</span>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CommonEventEmitter.off
---

# CommonEventEmitter.off() method

### Signature

```typescript
interface CommonEventEmitter {
  off<Key extends keyof Events>(
    type: Key,
    handler?: Handler<Events[Key]>,
  ): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

</td></tr>
<tr><td>

handler

</td><td>

[Handler](./puppeteer.handler.md)&lt;Events\[Key\]&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

this

    ---
sidebar_label: CommonEventEmitter.on
---

# CommonEventEmitter.on() method

### Signature

```typescript
interface CommonEventEmitter {
  on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

</td></tr>
<tr><td>

handler

</td><td>

[Handler](./puppeteer.handler.md)&lt;Events\[Key\]&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

this

    ---
sidebar_label: CommonEventEmitter.once
---

# CommonEventEmitter.once() method

### Signature

```typescript
interface CommonEventEmitter {
  once<Key extends keyof Events>(
    type: Key,
    handler: Handler<Events[Key]>,
  ): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

</td></tr>
<tr><td>

handler

</td><td>

[Handler](./puppeteer.handler.md)&lt;Events\[Key\]&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

this

    ---
sidebar_label: CommonEventEmitter.removeAllListeners
---

# CommonEventEmitter.removeAllListeners() method

### Signature

```typescript
interface CommonEventEmitter {
  removeAllListeners(event?: keyof Events): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

event

</td><td>

keyof Events

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

this

    ---
sidebar_label: Configuration
---

# Configuration interface

Defines options to configure Puppeteer's behavior during installation and runtime.

See individual properties for more information.

### Signature

```typescript
export interface Configuration
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="_chrome-headless-shell_">"chrome-headless-shell"</span>

</td><td>

`optional`

</td><td>

[ChromeHeadlessShellSettings](./puppeteer.chromeheadlessshellsettings.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="cachedirectory">cacheDirectory</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Defines the directory to be used by Puppeteer for caching.

Can be overridden by `PUPPETEER_CACHE_DIR`.

</td><td>

`path.join(os.homedir(), '.cache', 'puppeteer')`

</td></tr>
<tr><td>

<span id="chrome">chrome</span>

</td><td>

`optional`

</td><td>

[ChromeSettings](./puppeteer.chromesettings.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="defaultbrowser">defaultBrowser</span>

</td><td>

`optional`

</td><td>

[SupportedBrowser](./puppeteer.supportedbrowser.md)

</td><td>

Specifies which browser you'd like Puppeteer to use.

Can be overridden by `PUPPETEER_BROWSER`.

</td><td>

`chrome`

</td></tr>
<tr><td>

<span id="executablepath">executablePath</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Specifies an executable path to be used in [puppeteer.launch](./puppeteer.puppeteernode.launch.md).

Can be overridden by `PUPPETEER_EXECUTABLE_PATH`.

</td><td>

**Auto-computed.**

</td></tr>
<tr><td>

<span id="experiments">experiments</span>

</td><td>

`optional`

</td><td>

[ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md)

</td><td>

Defines experimental options for Puppeteer.

</td><td>

</td></tr>
<tr><td>

<span id="firefox">firefox</span>

</td><td>

`optional`

</td><td>

[FirefoxSettings](./puppeteer.firefoxsettings.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="loglevel">logLevel</span>

</td><td>

`optional`

</td><td>

'silent' \| 'error' \| 'warn'

</td><td>

Tells Puppeteer to log at the given level.

</td><td>

`warn`

</td></tr>
<tr><td>

<span id="skipdownload">skipDownload</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Tells Puppeteer to not download during installation.

Can be overridden by `PUPPETEER_SKIP_DOWNLOAD`.

</td><td>

</td></tr>
<tr><td>

<span id="temporarydirectory">temporaryDirectory</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Defines the directory to be used by Puppeteer for creating temporary files.

Can be overridden by `PUPPETEER_TMP_DIR`.

</td><td>

`os.tmpdir()`

</td></tr>
</tbody></table>

    ---
sidebar_label: connect
---

# connect() function

### Signature

```typescript
connect: (options: PuppeteerCore.ConnectOptions) =>
  Promise<PuppeteerCore.Browser>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[PuppeteerCore.ConnectOptions](./puppeteer.connectoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[PuppeteerCore.Browser](./puppeteer.browser.md)&gt;

    ---
sidebar_label: Connection.(constructor)
---

# Connection.(constructor)

Constructs a new instance of the `Connection` class

### Signature

```typescript
class Connection {
  constructor(
    url: string,
    transport: ConnectionTransport,
    delay?: number,
    timeout?: number,
    rawErrors?: boolean,
  );
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

url

</td><td>

string

</td><td>

</td></tr>
<tr><td>

transport

</td><td>

[ConnectionTransport](./puppeteer.connectiontransport.md)

</td><td>

</td></tr>
<tr><td>

delay

</td><td>

number

</td><td>

_(Optional)_

</td></tr>
<tr><td>

timeout

</td><td>

number

</td><td>

_(Optional)_

</td></tr>
<tr><td>

rawErrors

</td><td>

boolean

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

    ---
sidebar_label: Connection.createSession
---

# Connection.createSession() method

### Signature

```typescript
class Connection {
  createSession(targetInfo: Protocol.Target.TargetInfo): Promise<CDPSession>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

targetInfo

</td><td>

Protocol.Target.TargetInfo

</td><td>

The target info

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[CDPSession](./puppeteer.cdpsession.md)&gt;

The CDP session that is created

    ---
sidebar_label: Connection.dispose
---

# Connection.dispose() method

### Signature

```typescript
class Connection {
  dispose(): void;
}
```

**Returns:**

void

    ---
sidebar_label: Connection.fromSession
---

# Connection.fromSession() method

### Signature

```typescript
class Connection {
  static fromSession(session: CDPSession): Connection | undefined;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

session

</td><td>

[CDPSession](./puppeteer.cdpsession.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Connection](./puppeteer.connection.md) \| undefined

    ---
sidebar_label: Connection
---

# Connection class

### Signature

```typescript
export declare class Connection extends EventEmitter<CDPSessionEvents>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[CDPSessionEvents](./puppeteer.cdpsessionevents.md)&gt;

## Constructors

<table><thead><tr><th>

Constructor

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_constructor_">[(constructor)(url, transport, delay, timeout, rawErrors)](./puppeteer.connection._constructor_.md)</span>

</td><td>

</td><td>

Constructs a new instance of the `Connection` class

</td></tr>
</tbody></table>

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="timeout">timeout</span>

</td><td>

`readonly`

</td><td>

number

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="createsession">[createSession(targetInfo)](./puppeteer.connection.createsession.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="dispose">[dispose()](./puppeteer.connection.dispose.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="fromsession">[fromSession(session)](./puppeteer.connection.fromsession.md)</span>

</td><td>

`static`

</td><td>

</td></tr>
<tr><td>

<span id="send">[send(method, params, options)](./puppeteer.connection.send.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="session">[session(sessionId)](./puppeteer.connection.session.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="url">[url()](./puppeteer.connection.url.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Connection.send
---

# Connection.send() method

### Signature

```typescript
class Connection {
  send<T extends keyof ProtocolMapping.Commands>(
    method: T,
    params?: ProtocolMapping.Commands[T]['paramsType'][0],
    options?: CommandOptions,
  ): Promise<ProtocolMapping.Commands[T]['returnType']>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

method

</td><td>

T

</td><td>

</td></tr>
<tr><td>

params

</td><td>

ProtocolMapping.Commands\[T\]\['paramsType'\]\[0\]

</td><td>

_(Optional)_

</td></tr>
<tr><td>

options

</td><td>

[CommandOptions](./puppeteer.commandoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;ProtocolMapping.Commands\[T\]\['returnType'\]&gt;

    ---
sidebar_label: Connection.session
---

# Connection.session() method

### Signature

```typescript
class Connection {
  session(sessionId: string): CDPSession | null;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

sessionId

</td><td>

string

</td><td>

The session id

</td></tr>
</tbody></table>

**Returns:**

[CDPSession](./puppeteer.cdpsession.md) \| null

The current CDP session if it exists

    ---
sidebar_label: Connection.url
---

# Connection.url() method

### Signature

```typescript
class Connection {
  url(): string;
}
```

**Returns:**

string

    ---
sidebar_label: ConnectionClosedError
---

# ConnectionClosedError class

Thrown if underlying protocol connection has been closed.

### Signature

```typescript
export declare class ConnectionClosedError extends ProtocolError
```

**Extends:** [ProtocolError](./puppeteer.protocolerror.md)

    ---
sidebar_label: ConnectionTransport.close
---

# ConnectionTransport.close() method

### Signature

```typescript
interface ConnectionTransport {
  close(): void;
}
```

**Returns:**

void

    ---
sidebar_label: ConnectionTransport
---

# ConnectionTransport interface

### Signature

```typescript
export interface ConnectionTransport
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="onclose">onclose</span>

</td><td>

`optional`

</td><td>

() =&gt; void

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="onmessage">onmessage</span>

</td><td>

`optional`

</td><td>

(message: string) =&gt; void

</td><td>

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="close">[close()](./puppeteer.connectiontransport.close.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="send">[send(message)](./puppeteer.connectiontransport.send.md)</span>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ConnectionTransport.send
---

# ConnectionTransport.send() method

### Signature

```typescript
interface ConnectionTransport {
  send(message: string): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

message

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

void

    ---
sidebar_label: ConnectOptions
---

# ConnectOptions interface

Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance.

### Signature

```typescript
export interface ConnectOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="acceptinsecurecerts">acceptInsecureCerts</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to ignore HTTPS errors during navigation.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="browserurl">browserURL</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="browserwsendpoint">browserWSEndpoint</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="capabilities">capabilities</span>

</td><td>

`optional`

</td><td>

[SupportedWebDriverCapabilities](./puppeteer.supportedwebdrivercapabilities.md)

</td><td>

WebDriver BiDi capabilities passed to BiDi `session.new`.

**Remarks:**

Only works for `protocol="webDriverBiDi"` and [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).

</td><td>

</td></tr>
<tr><td>

<span id="defaultviewport">defaultViewport</span>

</td><td>

`optional`

</td><td>

[Viewport](./puppeteer.viewport.md) \| null

</td><td>

Sets the viewport for each page.

</td><td>

'&#123;width: 800, height: 600&#125;'

</td></tr>
<tr><td>

<span id="downloadbehavior">downloadBehavior</span>

</td><td>

`optional`

</td><td>

[DownloadBehavior](./puppeteer.downloadbehavior.md)

</td><td>

Sets the download behavior for the context.

</td><td>

</td></tr>
<tr><td>

<span id="headers">headers</span>

</td><td>

`optional`

</td><td>

Record&lt;string, string&gt;

</td><td>

Headers to use for the web socket connection.

**Remarks:**

Only works in the Node.js environment.

</td><td>

</td></tr>
<tr><td>

<span id="networkenabled">networkEnabled</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

**_(Experimental)_** Experimental setting to disable monitoring network events by default. When set to `false`, parts of Puppeteer that depend on network events would not work such as HTTPRequest and HTTPResponse.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="protocol">protocol</span>

</td><td>

`optional`

</td><td>

[ProtocolType](./puppeteer.protocoltype.md)

</td><td>

</td><td>

Determined at run time:

- Launching Chrome - 'cdp'.

- Launching Firefox - 'webDriverBiDi'.

- Connecting to a browser - 'cdp'.

</td></tr>
<tr><td>

<span id="protocoltimeout">protocolTimeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Timeout setting for individual protocol (CDP) calls.

</td><td>

`180_000`

</td></tr>
<tr><td>

<span id="slowmo">slowMo</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging.

</td><td>

</td></tr>
<tr><td>

<span id="targetfilter">targetFilter</span>

</td><td>

`optional`

</td><td>

[TargetFilterCallback](./puppeteer.targetfiltercallback.md)

</td><td>

Callback to decide if Puppeteer should connect to a given target or not.

</td><td>

</td></tr>
<tr><td>

<span id="transport">transport</span>

</td><td>

`optional`

</td><td>

[ConnectionTransport](./puppeteer.connectiontransport.md)

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ConsoleMessage.args
---

# ConsoleMessage.args() method

An array of arguments passed to the console.

### Signature

```typescript
class ConsoleMessage {
  args(): JSHandle[];
}
```

**Returns:**

[JSHandle](./puppeteer.jshandle.md)\[\]

    ---
sidebar_label: ConsoleMessage.location
---

# ConsoleMessage.location() method

The location of the console message.

### Signature

```typescript
class ConsoleMessage {
  location(): ConsoleMessageLocation;
}
```

**Returns:**

[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)

    ---
sidebar_label: ConsoleMessage
---

# ConsoleMessage class

ConsoleMessage objects are dispatched by page via the 'console' event.

### Signature

```typescript
export declare class ConsoleMessage
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ConsoleMessage` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="args">[args()](./puppeteer.consolemessage.args.md)</span>

</td><td>

</td><td>

An array of arguments passed to the console.

</td></tr>
<tr><td>

<span id="location">[location()](./puppeteer.consolemessage.location.md)</span>

</td><td>

</td><td>

The location of the console message.

</td></tr>
<tr><td>

<span id="stacktrace">[stackTrace()](./puppeteer.consolemessage.stacktrace.md)</span>

</td><td>

</td><td>

The array of locations on the stack of the console message.

</td></tr>
<tr><td>

<span id="text">[text()](./puppeteer.consolemessage.text.md)</span>

</td><td>

</td><td>

The text of the console message.

</td></tr>
<tr><td>

<span id="type">[type()](./puppeteer.consolemessage.type.md)</span>

</td><td>

</td><td>

The type of the console message.

</td></tr>
</tbody></table>

    ---
sidebar_label: ConsoleMessage.stackTrace
---

# ConsoleMessage.stackTrace() method

The array of locations on the stack of the console message.

### Signature

```typescript
class ConsoleMessage {
  stackTrace(): ConsoleMessageLocation[];
}
```

**Returns:**

[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)\[\]

    ---
sidebar_label: ConsoleMessage.text
---

# ConsoleMessage.text() method

The text of the console message.

### Signature

```typescript
class ConsoleMessage {
  text(): string;
}
```

**Returns:**

string

    ---
sidebar_label: ConsoleMessage.type
---

# ConsoleMessage.type() method

The type of the console message.

### Signature

```typescript
class ConsoleMessage {
  type(): ConsoleMessageType;
}
```

**Returns:**

[ConsoleMessageType](./puppeteer.consolemessagetype.md)

    ---
sidebar_label: ConsoleMessageLocation
---

# ConsoleMessageLocation interface

### Signature

```typescript
export interface ConsoleMessageLocation
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="columnnumber">columnNumber</span>

</td><td>

`optional`

</td><td>

number

</td><td>

0-based column number in the resource if known or `undefined` otherwise.

</td><td>

</td></tr>
<tr><td>

<span id="linenumber">lineNumber</span>

</td><td>

`optional`

</td><td>

number

</td><td>

0-based line number in the resource if known or `undefined` otherwise.

</td><td>

</td></tr>
<tr><td>

<span id="url">url</span>

</td><td>

`optional`

</td><td>

string

</td><td>

URL of the resource if known or `undefined` otherwise.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ConsoleMessageType
---

# ConsoleMessageType type

The supported types for console messages.

### Signature

```typescript
export type ConsoleMessageType =
  | 'log'
  | 'debug'
  | 'info'
  | 'error'
  | 'warn'
  | 'dir'
  | 'dirxml'
  | 'table'
  | 'trace'
  | 'clear'
  | 'startGroup'
  | 'startGroupCollapsed'
  | 'endGroup'
  | 'assert'
  | 'profile'
  | 'profileEnd'
  | 'count'
  | 'timeEnd'
  | 'verbose';
```

    ---
sidebar_label: ContinueRequestOverrides
---

# ContinueRequestOverrides interface

### Signature

```typescript
export interface ContinueRequestOverrides
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="headers">headers</span>

</td><td>

`optional`

</td><td>

Record&lt;string, string&gt;

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="method">method</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="postdata">postData</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="url">url</span>

</td><td>

`optional`

</td><td>

string

</td><td>

If set, the request URL will change. This is not a redirect.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Cookie
---

# Cookie interface

Represents a cookie object.

### Signature

```typescript
export interface Cookie extends CookieData
```

**Extends:** [CookieData](./puppeteer.cookiedata.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="domain">domain</span>

</td><td>

</td><td>

string

</td><td>

Cookie domain.

</td><td>

</td></tr>
<tr><td>

<span id="expires">expires</span>

</td><td>

</td><td>

number

</td><td>

Cookie expiration date as the number of seconds since the UNIX epoch. Set to `-1` for session cookies

</td><td>

</td></tr>
<tr><td>

<span id="httponly">httpOnly</span>

</td><td>

</td><td>

boolean

</td><td>

True if cookie is http-only.

</td><td>

</td></tr>
<tr><td>

<span id="name">name</span>

</td><td>

</td><td>

string

</td><td>

Cookie name.

</td><td>

</td></tr>
<tr><td>

<span id="partitionkey">partitionKey</span>

</td><td>

`optional`

</td><td>

[CookiePartitionKey](./puppeteer.cookiepartitionkey.md) \| string

</td><td>

Cookie partition key. In Chrome, it is the top-level site the partitioned cookie is available in. In Firefox, it matches the source origin in the [PartitionKey](https://w3c.github.io/webdriver-bidi/#type-storage-PartitionKey).

</td><td>

</td></tr>
<tr><td>

<span id="partitionkeyopaque">partitionKeyOpaque</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie partition key is opaque. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

</td><td>

string

</td><td>

Cookie path.

</td><td>

</td></tr>
<tr><td>

<span id="priority">priority</span>

</td><td>

`optional`

</td><td>

[CookiePriority](./puppeteer.cookiepriority.md)

</td><td>

Cookie Priority. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="sameparty">sameParty</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie is SameParty. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="samesite">sameSite</span>

</td><td>

`optional`

</td><td>

[CookieSameSite](./puppeteer.cookiesamesite.md)

</td><td>

Cookie SameSite type.

</td><td>

</td></tr>
<tr><td>

<span id="secure">secure</span>

</td><td>

</td><td>

boolean

</td><td>

True if cookie is secure.

</td><td>

</td></tr>
<tr><td>

<span id="session">session</span>

</td><td>

</td><td>

boolean

</td><td>

True in case of session cookie.

</td><td>

</td></tr>
<tr><td>

<span id="size">size</span>

</td><td>

</td><td>

number

</td><td>

Cookie size.

</td><td>

</td></tr>
<tr><td>

<span id="sourcescheme">sourceScheme</span>

</td><td>

`optional`

</td><td>

[CookieSourceScheme](./puppeteer.cookiesourcescheme.md)

</td><td>

Cookie source scheme type. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="value">value</span>

</td><td>

</td><td>

string

</td><td>

Cookie value.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CookieData
---

# CookieData interface

Cookie parameter object used to set cookies in the browser-level cookies API.

### Signature

```typescript
export interface CookieData
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="domain">domain</span>

</td><td>

</td><td>

string

</td><td>

Cookie domain.

</td><td>

</td></tr>
<tr><td>

<span id="expires">expires</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Cookie expiration date, session cookie if not set

</td><td>

</td></tr>
<tr><td>

<span id="httponly">httpOnly</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie is http-only.

</td><td>

</td></tr>
<tr><td>

<span id="name">name</span>

</td><td>

</td><td>

string

</td><td>

Cookie name.

</td><td>

</td></tr>
<tr><td>

<span id="partitionkey">partitionKey</span>

</td><td>

`optional`

</td><td>

[CookiePartitionKey](./puppeteer.cookiepartitionkey.md) \| string

</td><td>

Cookie partition key. In Chrome, it matches the top-level site the partitioned cookie is available in. In Firefox, it matches the source origin in the [PartitionKey](https://w3c.github.io/webdriver-bidi/#type-storage-PartitionKey).

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Cookie path.

</td><td>

</td></tr>
<tr><td>

<span id="priority">priority</span>

</td><td>

`optional`

</td><td>

[CookiePriority](./puppeteer.cookiepriority.md)

</td><td>

Cookie Priority. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="sameparty">sameParty</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie is SameParty. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="samesite">sameSite</span>

</td><td>

`optional`

</td><td>

[CookieSameSite](./puppeteer.cookiesamesite.md)

</td><td>

Cookie SameSite type.

</td><td>

</td></tr>
<tr><td>

<span id="secure">secure</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie is secure.

</td><td>

</td></tr>
<tr><td>

<span id="sourcescheme">sourceScheme</span>

</td><td>

`optional`

</td><td>

[CookieSourceScheme](./puppeteer.cookiesourcescheme.md)

</td><td>

Cookie source scheme type. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="value">value</span>

</td><td>

</td><td>

string

</td><td>

Cookie value.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CookieParam
---

# CookieParam interface

Cookie parameter object used to set cookies in the page-level cookies API.

### Signature

```typescript
export interface CookieParam
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="domain">domain</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Cookie domain.

</td><td>

</td></tr>
<tr><td>

<span id="expires">expires</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Cookie expiration date, session cookie if not set

</td><td>

</td></tr>
<tr><td>

<span id="httponly">httpOnly</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie is http-only.

</td><td>

</td></tr>
<tr><td>

<span id="name">name</span>

</td><td>

</td><td>

string

</td><td>

Cookie name.

</td><td>

</td></tr>
<tr><td>

<span id="partitionkey">partitionKey</span>

</td><td>

`optional`

</td><td>

[CookiePartitionKey](./puppeteer.cookiepartitionkey.md) \| string

</td><td>

Cookie partition key. In Chrome, it matches the top-level site the partitioned cookie is available in. In Firefox, it matches the source origin in the [PartitionKey](https://w3c.github.io/webdriver-bidi/#type-storage-PartitionKey).

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Cookie path.

</td><td>

</td></tr>
<tr><td>

<span id="priority">priority</span>

</td><td>

`optional`

</td><td>

[CookiePriority](./puppeteer.cookiepriority.md)

</td><td>

Cookie Priority. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="sameparty">sameParty</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie is SameParty. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="samesite">sameSite</span>

</td><td>

`optional`

</td><td>

[CookieSameSite](./puppeteer.cookiesamesite.md)

</td><td>

Cookie SameSite type.

</td><td>

</td></tr>
<tr><td>

<span id="secure">secure</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

True if cookie is secure.

</td><td>

</td></tr>
<tr><td>

<span id="sourcescheme">sourceScheme</span>

</td><td>

`optional`

</td><td>

[CookieSourceScheme](./puppeteer.cookiesourcescheme.md)

</td><td>

Cookie source scheme type. Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="url">url</span>

</td><td>

`optional`

</td><td>

string

</td><td>

The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, and source scheme values of the created cookie.

</td><td>

</td></tr>
<tr><td>

<span id="value">value</span>

</td><td>

</td><td>

string

</td><td>

Cookie value.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CookiePartitionKey
---

# CookiePartitionKey interface

Represents a cookie partition key in Chrome.

### Signature

```typescript
export interface CookiePartitionKey
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="hascrosssiteancestor">hasCrossSiteAncestor</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Indicates if the cookie has any ancestors that are cross-site to the topLevelSite.

Supported only in Chrome.

</td><td>

</td></tr>
<tr><td>

<span id="sourceorigin">sourceOrigin</span>

</td><td>

</td><td>

string

</td><td>

The site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie.

In Chrome, maps to the CDP's `topLevelSite` partition key.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CookiePriority
---

# CookiePriority type

Represents the cookie's 'Priority' status: https://tools.ietf.org/html/draft-west-cookie-priority-00

### Signature

```typescript
export type CookiePriority = 'Low' | 'Medium' | 'High';
```

    ---
sidebar_label: CookieSameSite
---

# CookieSameSite type

Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies

### Signature

```typescript
export type CookieSameSite = 'Strict' | 'Lax' | 'None';
```

    ---
sidebar_label: CookieSourceScheme
---

# CookieSourceScheme type

Represents the source scheme of the origin that originally set the cookie. A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. This is a temporary ability and it will be removed in the future.

### Signature

```typescript
export type CookieSourceScheme = 'Unset' | 'NonSecure' | 'Secure';
```

    ---
sidebar_label: Coverage
---

# Coverage class

The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page.

### Signature

```typescript
export declare class Coverage
```

## Remarks

To output coverage in a form consumable by [Istanbul](https://github.com/istanbuljs), see [puppeteer-to-istanbul](https://github.com/istanbuljs/puppeteer-to-istanbul).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Coverage` class.

## Example

An example of using JavaScript and CSS coverage to get percentage of initially executed code:

```ts
// Enable both JavaScript and CSS coverage
await Promise.all([
  page.coverage.startJSCoverage(),
  page.coverage.startCSSCoverage(),
]);
// Navigate to page
await page.goto('https://example.com');
// Disable both JavaScript and CSS coverage
const [jsCoverage, cssCoverage] = await Promise.all([
  page.coverage.stopJSCoverage(),
  page.coverage.stopCSSCoverage(),
]);
let totalBytes = 0;
let usedBytes = 0;
const coverage = [...jsCoverage, ...cssCoverage];
for (const entry of coverage) {
  totalBytes += entry.text.length;
  for (const range of entry.ranges) usedBytes += range.end - range.start - 1;
}
console.log(`Bytes used: ${(usedBytes / totalBytes) * 100}%`);
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="startcsscoverage">[startCSSCoverage(options)](./puppeteer.coverage.startcsscoverage.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="startjscoverage">[startJSCoverage(options)](./puppeteer.coverage.startjscoverage.md)</span>

</td><td>

</td><td>

**Remarks:**

Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts URL will start with `debugger://VM` (unless a magic //\# sourceURL comment is present, in which case that will the be URL).

</td></tr>
<tr><td>

<span id="stopcsscoverage">[stopCSSCoverage()](./puppeteer.coverage.stopcsscoverage.md)</span>

</td><td>

</td><td>

Promise that resolves to the array of coverage reports for all stylesheets.

**Remarks:**

CSS Coverage doesn't include dynamically injected style tags without sourceURLs.

</td></tr>
<tr><td>

<span id="stopjscoverage">[stopJSCoverage()](./puppeteer.coverage.stopjscoverage.md)</span>

</td><td>

</td><td>

Promise that resolves to the array of coverage reports for all scripts.

**Remarks:**

JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are reported.

</td></tr>
</tbody></table>

    ---
sidebar_label: Coverage.startCSSCoverage
---

# Coverage.startCSSCoverage() method

### Signature

```typescript
class Coverage {
  startCSSCoverage(options?: CSSCoverageOptions): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[CSSCoverageOptions](./puppeteer.csscoverageoptions.md)

</td><td>

_(Optional)_ Set of configurable options for coverage, defaults to `resetOnNavigation : true`

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

Promise that resolves when coverage is started.

    ---
sidebar_label: Coverage.startJSCoverage
---

# Coverage.startJSCoverage() method

### Signature

```typescript
class Coverage {
  startJSCoverage(options?: JSCoverageOptions): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[JSCoverageOptions](./puppeteer.jscoverageoptions.md)

</td><td>

_(Optional)_ Set of configurable options for coverage defaults to `resetOnNavigation : true, reportAnonymousScripts : false,` `includeRawScriptCoverage : false, useBlockCoverage : true`

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

Promise that resolves when coverage is started.

## Remarks

Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts URL will start with `debugger://VM` (unless a magic //\# sourceURL comment is present, in which case that will the be URL).

    ---
sidebar_label: Coverage.stopCSSCoverage
---

# Coverage.stopCSSCoverage() method

Promise that resolves to the array of coverage reports for all stylesheets.

### Signature

```typescript
class Coverage {
  stopCSSCoverage(): Promise<CoverageEntry[]>;
}
```

**Returns:**

Promise&lt;[CoverageEntry](./puppeteer.coverageentry.md)\[\]&gt;

## Remarks

CSS Coverage doesn't include dynamically injected style tags without sourceURLs.

    ---
sidebar_label: Coverage.stopJSCoverage
---

# Coverage.stopJSCoverage() method

Promise that resolves to the array of coverage reports for all scripts.

### Signature

```typescript
class Coverage {
  stopJSCoverage(): Promise<JSCoverageEntry[]>;
}
```

**Returns:**

Promise&lt;[JSCoverageEntry](./puppeteer.jscoverageentry.md)\[\]&gt;

## Remarks

JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are reported.

    ---
sidebar_label: CoverageEntry
---

# CoverageEntry interface

The CoverageEntry class represents one entry of the coverage report.

### Signature

```typescript
export interface CoverageEntry
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="ranges">ranges</span>

</td><td>

</td><td>

Array&lt;&#123; start: number; end: number; &#125;&gt;

</td><td>

The covered range as start and end positions.

</td><td>

</td></tr>
<tr><td>

<span id="text">text</span>

</td><td>

</td><td>

string

</td><td>

The content of the style sheet or script.

</td><td>

</td></tr>
<tr><td>

<span id="url">url</span>

</td><td>

</td><td>

string

</td><td>

The URL of the style sheet or script.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Credentials
---

# Credentials interface

### Signature

```typescript
export interface Credentials
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="password">password</span>

</td><td>

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="username">username</span>

</td><td>

</td><td>

string

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CSSCoverage.(constructor)
---

# CSSCoverage.(constructor)

Constructs a new instance of the `CSSCoverage` class

### Signature

```typescript
class CSSCoverage {
  constructor(client: CDPSession);
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

client

</td><td>

[CDPSession](./puppeteer.cdpsession.md)

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CSSCoverage
---

# CSSCoverage class

### Signature

```typescript
export declare class CSSCoverage
```

## Constructors

<table><thead><tr><th>

Constructor

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_constructor_">[(constructor)(client)](./puppeteer.csscoverage._constructor_.md)</span>

</td><td>

</td><td>

Constructs a new instance of the `CSSCoverage` class

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="start">[start(options)](./puppeteer.csscoverage.start.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="stop">[stop()](./puppeteer.csscoverage.stop.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CSSCoverage.start
---

# CSSCoverage.start() method

### Signature

```typescript
class CSSCoverage {
  start(options?: {resetOnNavigation?: boolean}): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

&#123; resetOnNavigation?: boolean; &#125;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: CSSCoverage.stop
---

# CSSCoverage.stop() method

### Signature

```typescript
class CSSCoverage {
  stop(): Promise<CoverageEntry[]>;
}
```

**Returns:**

Promise&lt;[CoverageEntry](./puppeteer.coverageentry.md)\[\]&gt;

    ---
sidebar_label: CSSCoverageOptions
---

# CSSCoverageOptions interface

Set of configurable options for CSS coverage.

### Signature

```typescript
export interface CSSCoverageOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="resetonnavigation">resetOnNavigation</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to reset coverage on every navigation.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CustomQueryHandler
---

# CustomQueryHandler interface

### Signature

```typescript
export interface CustomQueryHandler
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="queryall">queryAll</span>

</td><td>

`optional`

</td><td>

(node: Node, selector: string) =&gt; Iterable&lt;Node&gt;

</td><td>

Searches for some [Nodes](https://developer.mozilla.org/en-US/docs/Web/API/Node) matching the given `selector` from [node](https://developer.mozilla.org/en-US/docs/Web/API/Node).

</td><td>

</td></tr>
<tr><td>

<span id="queryone">queryOne</span>

</td><td>

`optional`

</td><td>

(node: Node, selector: string) =&gt; Node \| null

</td><td>

Searches for a [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) matching the given `selector` from [node](https://developer.mozilla.org/en-US/docs/Web/API/Node).

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: DebugInfo
---

# DebugInfo interface

### Signature

```typescript
export interface DebugInfo
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="pendingprotocolerrors">pendingProtocolErrors</span>

</td><td>

</td><td>

Error\[\]

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: DEFAULT_INTERCEPT_RESOLUTION_PRIORITY
---

# DEFAULT_INTERCEPT_RESOLUTION_PRIORITY variable

The default cooperative request interception resolution priority

### Signature

```typescript
DEFAULT_INTERCEPT_RESOLUTION_PRIORITY = 0;
```

    ---
sidebar_label: defaultArgs
---

# defaultArgs() function

### Signature

```typescript
defaultArgs: (options?: PuppeteerCore.LaunchOptions) => string[]
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[PuppeteerCore.LaunchOptions](./puppeteer.launchoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

string\[\]

    ---
sidebar_label: DeleteCookiesRequest
---

# DeleteCookiesRequest interface

### Signature

```typescript
export interface DeleteCookiesRequest
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="domain">domain</span>

</td><td>

`optional`

</td><td>

string

</td><td>

If specified, deletes only cookies with the exact domain.

</td><td>

</td></tr>
<tr><td>

<span id="name">name</span>

</td><td>

</td><td>

string

</td><td>

Name of the cookies to remove.

</td><td>

</td></tr>
<tr><td>

<span id="partitionkey">partitionKey</span>

</td><td>

`optional`

</td><td>

[CookiePartitionKey](./puppeteer.cookiepartitionkey.md) \| string

</td><td>

If specified, deletes cookies in the given partition key. In Chrome, partitionKey matches the top-level site the partitioned cookie is available in. In Firefox, it matches the source origin in the [PartitionKey](https://w3c.github.io/webdriver-bidi/#type-storage-PartitionKey).

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

string

</td><td>

If specified, deletes only cookies with the exact path.

</td><td>

</td></tr>
<tr><td>

<span id="url">url</span>

</td><td>

`optional`

</td><td>

string

</td><td>

If specified, deletes all the cookies with the given name where domain and path match provided URL. Otherwise, deletes only cookies related to the current page's domain.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Device
---

# Device interface

### Signature

```typescript
export interface Device
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="useragent">userAgent</span>

</td><td>

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="viewport">viewport</span>

</td><td>

</td><td>

[Viewport](./puppeteer.viewport.md)

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: DeviceRequestPrompt.cancel
---

# DeviceRequestPrompt.cancel() method

Cancel the prompt.

### Signature

```typescript
class DeviceRequestPrompt {
  cancel(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: DeviceRequestPrompt
---

# DeviceRequestPrompt class

Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth.

### Signature

```typescript
export declare class DeviceRequestPrompt
```

## Remarks

`DeviceRequestPrompt` instances are returned via the [Page.waitForDevicePrompt()](./puppeteer.page.waitfordeviceprompt.md) method.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `DeviceRequestPrompt` class.

## Example

```ts
const [devicePrompt] = Promise.all([
  page.waitForDevicePrompt(),
  page.click('#connect-bluetooth'),
]);
await devicePrompt.select(
  await devicePrompt.waitForDevice(({name}) => name.includes('My Device')),
);
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="devices">devices</span>

</td><td>

</td><td>

[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)\[\]

</td><td>

Current list of selectable devices.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="cancel">[cancel()](./puppeteer.devicerequestprompt.cancel.md)</span>

</td><td>

</td><td>

Cancel the prompt.

</td></tr>
<tr><td>

<span id="select">[select(device)](./puppeteer.devicerequestprompt.select.md)</span>

</td><td>

</td><td>

Select a device in the prompt's list.

</td></tr>
<tr><td>

<span id="waitfordevice">[waitForDevice(filter, options)](./puppeteer.devicerequestprompt.waitfordevice.md)</span>

</td><td>

</td><td>

Resolve to the first device in the prompt matching a filter.

</td></tr>
</tbody></table>

    ---
sidebar_label: DeviceRequestPrompt.select
---

# DeviceRequestPrompt.select() method

Select a device in the prompt's list.

### Signature

```typescript
class DeviceRequestPrompt {
  select(device: DeviceRequestPromptDevice): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

device

</td><td>

[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: DeviceRequestPrompt.waitForDevice
---

# DeviceRequestPrompt.waitForDevice() method

Resolve to the first device in the prompt matching a filter.

### Signature

```typescript
class DeviceRequestPrompt {
  waitForDevice(
    filter: (device: DeviceRequestPromptDevice) => boolean,
    options?: WaitTimeoutOptions,
  ): Promise<DeviceRequestPromptDevice>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

filter

</td><td>

(device: [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)) =&gt; boolean

</td><td>

</td></tr>
<tr><td>

options

</td><td>

[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)&gt;

    ---
sidebar_label: DeviceRequestPromptDevice
---

# DeviceRequestPromptDevice class

Device in a request prompt.

### Signature

```typescript
export declare class DeviceRequestPromptDevice
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `DeviceRequestPromptDevice` class.

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="id">id</span>

</td><td>

</td><td>

string

</td><td>

Device id during a prompt.

</td></tr>
<tr><td>

<span id="name">name</span>

</td><td>

</td><td>

string

</td><td>

Device name as it appears in a prompt.

</td></tr>
</tbody></table>

    ---
sidebar_label: Dialog.accept
---

# Dialog.accept() method

A promise that resolves when the dialog has been accepted.

### Signature

```typescript
class Dialog {
  accept(promptText?: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

promptText

</td><td>

string

</td><td>

_(Optional)_ optional text that will be entered in the dialog prompt. Has no effect if the dialog's type is not `prompt`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Dialog.defaultValue
---

# Dialog.defaultValue() method

The default value of the prompt, or an empty string if the dialog is not a `prompt`.

### Signature

```typescript
class Dialog {
  defaultValue(): string;
}
```

**Returns:**

string

    ---
sidebar_label: Dialog.dismiss
---

# Dialog.dismiss() method

A promise which will resolve once the dialog has been dismissed

### Signature

```typescript
class Dialog {
  dismiss(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Dialog
---

# Dialog class

Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the `dialog` event.

### Signature

```typescript
export declare abstract class Dialog
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Dialog` class.

## Example

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  page.on('dialog', async dialog => {
    console.log(dialog.message());
    await dialog.dismiss();
    await browser.close();
  });
  page.evaluate(() => alert('1'));
})();
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="accept">[accept(promptText)](./puppeteer.dialog.accept.md)</span>

</td><td>

</td><td>

A promise that resolves when the dialog has been accepted.

</td></tr>
<tr><td>

<span id="defaultvalue">[defaultValue()](./puppeteer.dialog.defaultvalue.md)</span>

</td><td>

</td><td>

The default value of the prompt, or an empty string if the dialog is not a `prompt`.

</td></tr>
<tr><td>

<span id="dismiss">[dismiss()](./puppeteer.dialog.dismiss.md)</span>

</td><td>

</td><td>

A promise which will resolve once the dialog has been dismissed

</td></tr>
<tr><td>

<span id="message">[message()](./puppeteer.dialog.message.md)</span>

</td><td>

</td><td>

The message displayed in the dialog.

</td></tr>
<tr><td>

<span id="type">[type()](./puppeteer.dialog.type.md)</span>

</td><td>

</td><td>

The type of the dialog.

</td></tr>
</tbody></table>

    ---
sidebar_label: Dialog.message
---

# Dialog.message() method

The message displayed in the dialog.

### Signature

```typescript
class Dialog {
  message(): string;
}
```

**Returns:**

string

    ---
sidebar_label: Dialog.type
---

# Dialog.type() method

The type of the dialog.

### Signature

```typescript
class Dialog {
  type(): Protocol.Page.DialogType;
}
```

**Returns:**

Protocol.Page.DialogType

    ---
sidebar_label: DownloadBehavior
---

# DownloadBehavior interface

### Signature

```typescript
export interface DownloadBehavior
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="downloadpath">downloadPath</span>

</td><td>

`optional`

</td><td>

string

</td><td>

The default path to save downloaded files to.

**Remarks:**

Setting this is required if behavior is set to `allow` or `allowAndName`.

</td><td>

</td></tr>
<tr><td>

<span id="policy">policy</span>

</td><td>

</td><td>

[DownloadPolicy](./puppeteer.downloadpolicy.md)

</td><td>

Whether to allow all or deny all download requests, or use default behavior if available.

**Remarks:**

Setting this to `allowAndName` will name all files according to their download guids.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: DownloadPolicy
---

# DownloadPolicy type

### Signature

```typescript
export type DownloadPolicy = 'deny' | 'allow' | 'allowAndName' | 'default';
```

    ---
sidebar_label: ElementFor
---

# ElementFor type

### Signature

```typescript
export type ElementFor<
  TagName extends keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap,
> = TagName extends keyof HTMLElementTagNameMap
  ? HTMLElementTagNameMap[TagName]
  : TagName extends keyof SVGElementTagNameMap
    ? SVGElementTagNameMap[TagName]
    : never;
```

    ---
sidebar_label: ElementHandle.$
---

# ElementHandle.$() method

Queries the current element for an element matching the given selector.

### Signature

```typescript
class ElementHandle {
  $<Selector extends string>(
    selector: Selector,
  ): Promise<ElementHandle<NodeFor<Selector>> | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt; \| null&gt;

A [element handle](./puppeteer.elementhandle.md) to the first element matching the given selector. Otherwise, `null`.

    ---
sidebar_label: ElementHandle.$$
---

# ElementHandle.$$() method

Queries the current element for all elements matching the given selector.

### Signature

```typescript
class ElementHandle {
  $$<Selector extends string>(
    selector: Selector,
    options?: QueryOptions,
  ): Promise<Array<ElementHandle<NodeFor<Selector>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

options

</td><td>

[QueryOptions](./puppeteer.queryoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Array&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt;&gt;&gt;

An array of [element handles](./puppeteer.elementhandle.md) that point to elements matching the given selector.

    ---
sidebar_label: ElementHandle.$$eval
---

# ElementHandle.$$eval() method

Runs the given function on an array of elements matching the given selector in the current element.

If the given function returns a promise, then this method will wait till the promise resolves.

### Signature

```typescript
class ElementHandle {
  $$eval<
    Selector extends string,
    Params extends unknown[],
    Func extends EvaluateFuncWith<
      Array<NodeFor<Selector>>,
      Params
    > = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
  >(
    selector: Selector,
    pageFunction: Func | string,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

The function to be evaluated in the element's page's context. An array of elements matching the given selector will be passed to the function as its first argument.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

Additional arguments to pass to `pageFunction`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

A promise to the result of the function.

## Example

HTML:

```html
<div class="feed">
  <div class="tweet">Hello!</div>
  <div class="tweet">Hi!</div>
</div>
```

JavaScript:

```ts
const feedHandle = await page.$('.feed');
expect(
  await feedHandle.$$eval('.tweet', nodes => nodes.map(n => n.innerText)),
).toEqual(['Hello!', 'Hi!']);
```

    ---
sidebar_label: ElementHandle.$eval
---

# ElementHandle.$eval() method

Runs the given function on the first element matching the given selector in the current element.

If the given function returns a promise, then this method will wait till the promise resolves.

### Signature

```typescript
class ElementHandle {
  $eval<
    Selector extends string,
    Params extends unknown[],
    Func extends EvaluateFuncWith<NodeFor<Selector>, Params> = EvaluateFuncWith<
      NodeFor<Selector>,
      Params
    >,
  >(
    selector: Selector,
    pageFunction: Func | string,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

The function to be evaluated in this element's page's context. The first element matching the selector will be passed in as the first argument.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

Additional arguments to pass to `pageFunction`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

A promise to the result of the function.

## Example

```ts
const tweetHandle = await page.$('.tweet');
expect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');
expect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10');
```

    ---
sidebar_label: ElementHandle.asLocator
---

# ElementHandle.asLocator() method

Creates a locator based on an ElementHandle. This would not allow refreshing the element handle if it is stale but it allows re-using other locator pre-conditions.

### Signature

```typescript
class ElementHandle {
  asLocator(this: ElementHandle<Element>): Locator<Element>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;Element&gt;

    ---
sidebar_label: ElementHandle.autofill
---

# ElementHandle.autofill() method

If the element is a form input, you can use [ElementHandle.autofill()](./puppeteer.elementhandle.autofill.md) to test if the form is compatible with the browser's autofill implementation. Throws an error if the form cannot be autofilled.

### Signature

```typescript
class ElementHandle {
  abstract autofill(data: AutofillData): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

data

</td><td>

[AutofillData](./puppeteer.autofilldata.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Currently, Puppeteer supports auto-filling credit card information only and in Chrome in the new headless and headful modes only.

```ts
// Select an input on the credit card form.
const name = await page.waitForSelector('form #name');
// Trigger autofill with the desired data.
await name.autofill({
  creditCard: {
    number: '4444444444444444',
    name: 'John Smith',
    expiryMonth: '01',
    expiryYear: '2030',
    cvc: '123',
  },
});
```

    ---
sidebar_label: ElementHandle.backendNodeId
---

# ElementHandle.backendNodeId() method

When connected using Chrome DevTools Protocol, it returns a DOM.BackendNodeId for the element.

### Signature

```typescript
class ElementHandle {
  abstract backendNodeId(): Promise<number>;
}
```

**Returns:**

Promise&lt;number&gt;

    ---
sidebar_label: ElementHandle.boundingBox
---

# ElementHandle.boundingBox() method

This method returns the bounding box of the element (relative to the main frame), or `null` if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: `display: none`).

### Signature

```typescript
class ElementHandle {
  boundingBox(): Promise<BoundingBox | null>;
}
```

**Returns:**

Promise&lt;[BoundingBox](./puppeteer.boundingbox.md) \| null&gt;

    ---
sidebar_label: ElementHandle.boxModel
---

# ElementHandle.boxModel() method

This method returns boxes of the element, or `null` if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: `display: none`).

### Signature

```typescript
class ElementHandle {
  boxModel(): Promise<BoxModel | null>;
}
```

**Returns:**

Promise&lt;[BoxModel](./puppeteer.boxmodel.md) \| null&gt;

## Remarks

Boxes are represented as an array of points; Each Point is an object `{x, y}`. Box points are sorted clock-wise.

    ---
sidebar_label: ElementHandle.click
---

# ElementHandle.click() method

This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to click in the center of the element. If the element is detached from DOM, the method throws an error.

### Signature

```typescript
class ElementHandle {
  click(
    this: ElementHandle<Element>,
    options?: Readonly<ClickOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[ClickOptions](./puppeteer.clickoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.clickablePoint
---

# ElementHandle.clickablePoint() method

Returns the middle point within an element unless a specific offset is provided.

### Signature

```typescript
class ElementHandle {
  clickablePoint(offset?: Offset): Promise<Point>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

offset

</td><td>

[Offset](./puppeteer.offset.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Point](./puppeteer.point.md)&gt;

    ---
sidebar_label: ElementHandle.contentFrame
---

# ElementHandle.contentFrame() method

<h2 id="contentFrame">contentFrame(): Promise&lt;Frame&gt;</h2>

Resolves the frame associated with the element, if any. Always exists for HTMLIFrameElements.

### Signature

```typescript
class ElementHandle {
  abstract contentFrame(this: ElementHandle<HTMLIFrameElement>): Promise<Frame>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLIFrameElement&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Frame](./puppeteer.frame.md)&gt;

<h2 id="contentFrame-1">contentFrame(): Promise&lt;Frame \| null&gt;</h2>

### Signature

```typescript
class ElementHandle {
  abstract contentFrame(): Promise<Frame | null>;
}
```

**Returns:**

Promise&lt;[Frame](./puppeteer.frame.md) \| null&gt;

    ---
sidebar_label: ElementHandle.drag
---

# ElementHandle.drag() method

Drags an element over the given element or point.

### Signature

```typescript
class ElementHandle {
  drag(
    this: ElementHandle<Element>,
    target: Point | ElementHandle<Element>,
  ): Promise<Protocol.Input.DragData | void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

target

</td><td>

[Point](./puppeteer.point.md) \| [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Protocol.Input.DragData \| void&gt;

DEPRECATED. When drag interception is enabled, the drag payload is returned.

    ---
sidebar_label: ElementHandle.dragAndDrop
---

# ElementHandle.dragAndDrop() method

> Warning: This API is now obsolete.
>
> Use `ElementHandle.drop` instead.

### Signature

```typescript
class ElementHandle {
  dragAndDrop(
    this: ElementHandle<Element>,
    target: ElementHandle<Node>,
    options?: {
      delay: number;
    },
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

target

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Node&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

&#123; delay: number; &#125;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.dragEnter
---

# ElementHandle.dragEnter() method

> Warning: This API is now obsolete.
>
> Do not use. `dragenter` will automatically be performed during dragging.

### Signature

```typescript
class ElementHandle {
  dragEnter(
    this: ElementHandle<Element>,
    data?: Protocol.Input.DragData,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

data

</td><td>

Protocol.Input.DragData

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.dragOver
---

# ElementHandle.dragOver() method

> Warning: This API is now obsolete.
>
> Do not use. `dragover` will automatically be performed during dragging.

### Signature

```typescript
class ElementHandle {
  dragOver(
    this: ElementHandle<Element>,
    data?: Protocol.Input.DragData,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

data

</td><td>

Protocol.Input.DragData

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.drop
---

# ElementHandle.drop() method

<h2 id="drop">drop(): Promise&lt;void&gt;</h2>

Drops the given element onto the current one.

### Signature

```typescript
class ElementHandle {
  drop(
    this: ElementHandle<Element>,
    element: ElementHandle<Element>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

element

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

<h2 id="drop-1">drop(): Promise&lt;void&gt;</h2>

> Warning: This API is now obsolete.
>
> No longer supported.

### Signature

```typescript
class ElementHandle {
  drop(
    this: ElementHandle<Element>,
    data?: Protocol.Input.DragData,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

data

</td><td>

Protocol.Input.DragData

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.focus
---

# ElementHandle.focus() method

Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.

### Signature

```typescript
class ElementHandle {
  focus(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.hover
---

# ElementHandle.hover() method

This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to hover over the center of the element. If the element is detached from DOM, the method throws an error.

### Signature

```typescript
class ElementHandle {
  hover(this: ElementHandle<Element>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.isHidden
---

# ElementHandle.isHidden() method

An element is considered to be hidden if at least one of the following is true:

- the element has no [computed styles](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle).

- the element has an empty [bounding client rect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).

- the element's [visibility](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility) is `hidden` or `collapse`.

### Signature

```typescript
class ElementHandle {
  isHidden(): Promise<boolean>;
}
```

**Returns:**

Promise&lt;boolean&gt;

    ---
sidebar_label: ElementHandle.isIntersectingViewport
---

# ElementHandle.isIntersectingViewport() method

Resolves to true if the element is visible in the current viewport. If an element is an SVG, we check if the svg owner element is in the viewport instead. See https://crbug.com/963246.

### Signature

```typescript
class ElementHandle {
  isIntersectingViewport(
    this: ElementHandle<Element>,
    options?: {
      threshold?: number;
    },
  ): Promise<boolean>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

&#123; threshold?: number; &#125;

</td><td>

_(Optional)_ Threshold for the intersection between 0 (no intersection) and 1 (full intersection). Defaults to 1.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;boolean&gt;

    ---
sidebar_label: ElementHandle.isVisible
---

# ElementHandle.isVisible() method

An element is considered to be visible if all of the following is true:

- the element has [computed styles](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle).

- the element has a non-empty [bounding client rect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).

- the element's [visibility](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility) is not `hidden` or `collapse`.

### Signature

```typescript
class ElementHandle {
  isVisible(): Promise<boolean>;
}
```

**Returns:**

Promise&lt;boolean&gt;

    ---
sidebar_label: ElementHandle
---

# ElementHandle class

ElementHandle represents an in-page DOM element.

### Signature

```typescript
export declare abstract class ElementHandle<ElementType extends Node = Element> extends JSHandle<ElementType>
```

**Extends:** [JSHandle](./puppeteer.jshandle.md)&lt;ElementType&gt;

## Remarks

ElementHandles can be created with the [Page.$()](./puppeteer.page._.md) method.

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  const hrefElement = await page.$('a');
  await hrefElement.click();
  // ...
})();
```

ElementHandle prevents the DOM element from being garbage-collected unless the handle is [disposed](./puppeteer.jshandle.dispose.md). ElementHandles are auto-disposed when their origin frame gets navigated.

ElementHandle instances can be used as arguments in [Page.$eval()](./puppeteer.page._eval.md) and [Page.evaluate()](./puppeteer.page.evaluate.md) methods.

If you're using TypeScript, ElementHandle takes a generic argument that denotes the type of element the handle is holding within. For example, if you have a handle to a `<select>` element, you can type it as `ElementHandle<HTMLSelectElement>` and you get some nicer type checks.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ElementHandle` class.

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="frame">frame</span>

</td><td>

`readonly`

</td><td>

[Frame](./puppeteer.frame.md)

</td><td>

Frame corresponding to the current handle.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_">[$(selector)](./puppeteer.elementhandle._.md)</span>

</td><td>

</td><td>

Queries the current element for an element matching the given selector.

</td></tr>
<tr><td>

<span id="__">[$$(selector, options)](./puppeteer.elementhandle.__.md)</span>

</td><td>

</td><td>

Queries the current element for all elements matching the given selector.

</td></tr>
<tr><td>

<span id="__eval">[$$eval(selector, pageFunction, args)](./puppeteer.elementhandle.__eval.md)</span>

</td><td>

</td><td>

Runs the given function on an array of elements matching the given selector in the current element.

If the given function returns a promise, then this method will wait till the promise resolves.

</td></tr>
<tr><td>

<span id="_eval">[$eval(selector, pageFunction, args)](./puppeteer.elementhandle._eval.md)</span>

</td><td>

</td><td>

Runs the given function on the first element matching the given selector in the current element.

If the given function returns a promise, then this method will wait till the promise resolves.

</td></tr>
<tr><td>

<span id="aslocator">[asLocator(this)](./puppeteer.elementhandle.aslocator.md)</span>

</td><td>

</td><td>

Creates a locator based on an ElementHandle. This would not allow refreshing the element handle if it is stale but it allows re-using other locator pre-conditions.

</td></tr>
<tr><td>

<span id="autofill">[autofill(data)](./puppeteer.elementhandle.autofill.md)</span>

</td><td>

</td><td>

If the element is a form input, you can use [ElementHandle.autofill()](./puppeteer.elementhandle.autofill.md) to test if the form is compatible with the browser's autofill implementation. Throws an error if the form cannot be autofilled.

**Remarks:**

Currently, Puppeteer supports auto-filling credit card information only and in Chrome in the new headless and headful modes only.

```ts
// Select an input on the credit card form.
const name = await page.waitForSelector('form #name');
// Trigger autofill with the desired data.
await name.autofill({
  creditCard: {
    number: '4444444444444444',
    name: 'John Smith',
    expiryMonth: '01',
    expiryYear: '2030',
    cvc: '123',
  },
});
```

</td></tr>
<tr><td>

<span id="backendnodeid">[backendNodeId()](./puppeteer.elementhandle.backendnodeid.md)</span>

</td><td>

</td><td>

When connected using Chrome DevTools Protocol, it returns a DOM.BackendNodeId for the element.

</td></tr>
<tr><td>

<span id="boundingbox">[boundingBox()](./puppeteer.elementhandle.boundingbox.md)</span>

</td><td>

</td><td>

This method returns the bounding box of the element (relative to the main frame), or `null` if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: `display: none`).

</td></tr>
<tr><td>

<span id="boxmodel">[boxModel()](./puppeteer.elementhandle.boxmodel.md)</span>

</td><td>

</td><td>

This method returns boxes of the element, or `null` if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: `display: none`).

**Remarks:**

Boxes are represented as an array of points; Each Point is an object `{x, y}`. Box points are sorted clock-wise.

</td></tr>
<tr><td>

<span id="click">[click(this, options)](./puppeteer.elementhandle.click.md)</span>

</td><td>

</td><td>

This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to click in the center of the element. If the element is detached from DOM, the method throws an error.

</td></tr>
<tr><td>

<span id="clickablepoint">[clickablePoint(offset)](./puppeteer.elementhandle.clickablepoint.md)</span>

</td><td>

</td><td>

Returns the middle point within an element unless a specific offset is provided.

</td></tr>
<tr><td>

<span id="contentframe">[contentFrame(this)](./puppeteer.elementhandle.contentframe.md)</span>

</td><td>

</td><td>

Resolves the frame associated with the element, if any. Always exists for HTMLIFrameElements.

</td></tr>
<tr><td>

<span id="contentframe">[contentFrame()](./puppeteer.elementhandle.contentframe.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="drag">[drag(this, target)](./puppeteer.elementhandle.drag.md)</span>

</td><td>

</td><td>

Drags an element over the given element or point.

</td></tr>
<tr><td>

<span id="draganddrop">[dragAndDrop(this, target, options)](./puppeteer.elementhandle.draganddrop.md)</span>

</td><td>

`deprecated`

</td><td>

**Deprecated:**

Use `ElementHandle.drop` instead.

</td></tr>
<tr><td>

<span id="dragenter">[dragEnter(this, data)](./puppeteer.elementhandle.dragenter.md)</span>

</td><td>

`deprecated`

</td><td>

**Deprecated:**

Do not use. `dragenter` will automatically be performed during dragging.

</td></tr>
<tr><td>

<span id="dragover">[dragOver(this, data)](./puppeteer.elementhandle.dragover.md)</span>

</td><td>

`deprecated`

</td><td>

**Deprecated:**

Do not use. `dragover` will automatically be performed during dragging.

</td></tr>
<tr><td>

<span id="drop">[drop(this, element)](./puppeteer.elementhandle.drop.md)</span>

</td><td>

</td><td>

Drops the given element onto the current one.

</td></tr>
<tr><td>

<span id="drop">[drop(this, data)](./puppeteer.elementhandle.drop.md)</span>

</td><td>

`deprecated`

</td><td>

**Deprecated:**

No longer supported.

</td></tr>
<tr><td>

<span id="focus">[focus()](./puppeteer.elementhandle.focus.md)</span>

</td><td>

</td><td>

Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.

</td></tr>
<tr><td>

<span id="hover">[hover(this)](./puppeteer.elementhandle.hover.md)</span>

</td><td>

</td><td>

This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to hover over the center of the element. If the element is detached from DOM, the method throws an error.

</td></tr>
<tr><td>

<span id="ishidden">[isHidden()](./puppeteer.elementhandle.ishidden.md)</span>

</td><td>

</td><td>

An element is considered to be hidden if at least one of the following is true:

- the element has no [computed styles](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle).

- the element has an empty [bounding client rect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).

- the element's [visibility](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility) is `hidden` or `collapse`.

</td></tr>
<tr><td>

<span id="isintersectingviewport">[isIntersectingViewport(this, options)](./puppeteer.elementhandle.isintersectingviewport.md)</span>

</td><td>

</td><td>

Resolves to true if the element is visible in the current viewport. If an element is an SVG, we check if the svg owner element is in the viewport instead. See https://crbug.com/963246.

</td></tr>
<tr><td>

<span id="isvisible">[isVisible()](./puppeteer.elementhandle.isvisible.md)</span>

</td><td>

</td><td>

An element is considered to be visible if all of the following is true:

- the element has [computed styles](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle).

- the element has a non-empty [bounding client rect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).

- the element's [visibility](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility) is not `hidden` or `collapse`.

</td></tr>
<tr><td>

<span id="press">[press(key, options)](./puppeteer.elementhandle.press.md)</span>

</td><td>

</td><td>

Focuses the element, and then uses [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md).

**Remarks:**

If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also be generated. The `text` option can be specified to force an input event to be generated.

**NOTE** Modifier keys DO affect `elementHandle.press`. Holding down `Shift` will type the text in upper case.

</td></tr>
<tr><td>

<span id="screenshot">[screenshot(options)](./puppeteer.elementhandle.screenshot.md)</span>

</td><td>

</td><td>

This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error.

</td></tr>
<tr><td>

<span id="screenshot">[screenshot(options)](./puppeteer.elementhandle.screenshot.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="scrollintoview">[scrollIntoView(this)](./puppeteer.elementhandle.scrollintoview.md)</span>

</td><td>

</td><td>

Scrolls the element into view using either the automation protocol client or by calling element.scrollIntoView.

</td></tr>
<tr><td>

<span id="select">[select(values)](./puppeteer.elementhandle.select.md)</span>

</td><td>

</td><td>

Triggers a `change` and `input` event once all the provided options have been selected. If there's no `<select>` element matching `selector`, the method throws an error.

</td></tr>
<tr><td>

<span id="tap">[tap(this)](./puppeteer.elementhandle.tap.md)</span>

</td><td>

</td><td>

This method scrolls element into view if needed, and then uses [Touchscreen.tap()](./puppeteer.touchscreen.tap.md) to tap in the center of the element. If the element is detached from DOM, the method throws an error.

</td></tr>
<tr><td>

<span id="toelement">[toElement(tagName)](./puppeteer.elementhandle.toelement.md)</span>

</td><td>

</td><td>

Converts the current handle to the given element type.

</td></tr>
<tr><td>

<span id="touchend">[touchEnd(this)](./puppeteer.elementhandle.touchend.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="touchmove">[touchMove(this, touch)](./puppeteer.elementhandle.touchmove.md)</span>

</td><td>

</td><td>

This method scrolls the element into view if needed, and then moves the touch to the center of the element.

</td></tr>
<tr><td>

<span id="touchstart">[touchStart(this)](./puppeteer.elementhandle.touchstart.md)</span>

</td><td>

</td><td>

This method scrolls the element into view if needed, and then starts a touch in the center of the element.

</td></tr>
<tr><td>

<span id="type">[type(text, options)](./puppeteer.elementhandle.type.md)</span>

</td><td>

</td><td>

Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

To press a special key, like `Control` or `ArrowDown`, use [ElementHandle.press()](./puppeteer.elementhandle.press.md).

</td></tr>
<tr><td>

<span id="uploadfile">[uploadFile(this, paths)](./puppeteer.elementhandle.uploadfile.md)</span>

</td><td>

</td><td>

Sets the value of an [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) to the given file paths.

**Remarks:**

This will not validate whether the file paths exists. Also, if a path is relative, then it is resolved against the [current working directory](https://nodejs.org/api/process.html#process_process_cwd). For locals script connecting to remote chrome environments, paths must be absolute.

</td></tr>
<tr><td>

<span id="waitforselector">[waitForSelector(selector, options)](./puppeteer.elementhandle.waitforselector.md)</span>

</td><td>

</td><td>

Wait for an element matching the given selector to appear in the current element.

Unlike [Frame.waitForSelector()](./puppeteer.frame.waitforselector.md), this method does not work across navigations or if the element is detached from DOM.

</td></tr>
</tbody></table>

    ---
sidebar_label: ElementHandle.press
---

# ElementHandle.press() method

Focuses the element, and then uses [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md).

### Signature

```typescript
class ElementHandle {
  press(key: KeyInput, options?: Readonly<KeyPressOptions>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

key

</td><td>

[KeyInput](./puppeteer.keyinput.md)

</td><td>

Name of key to press, such as `ArrowLeft`. See [KeyInput](./puppeteer.keyinput.md) for a list of all key names.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[KeyPressOptions](./puppeteer.keypressoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also be generated. The `text` option can be specified to force an input event to be generated.

**NOTE** Modifier keys DO affect `elementHandle.press`. Holding down `Shift` will type the text in upper case.

    ---
sidebar_label: ElementHandle.screenshot
---

# ElementHandle.screenshot() method

<h2 id="screenshot">screenshot(): Promise&lt;string&gt;</h2>

This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error.

### Signature

```typescript
class ElementHandle {
  screenshot(
    options: Readonly<ScreenshotOptions> & {
      encoding: 'base64';
    },
  ): Promise<string>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[ScreenshotOptions](./puppeteer.screenshotoptions.md)&gt; &amp; &#123; encoding: 'base64'; &#125;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string&gt;

<h2 id="screenshot-1">screenshot(): Promise&lt;Uint8Array&gt;</h2>

### Signature

```typescript
class ElementHandle {
  screenshot(options?: Readonly<ScreenshotOptions>): Promise<Uint8Array>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[ScreenshotOptions](./puppeteer.screenshotoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Uint8Array&gt;

    ---
sidebar_label: ElementHandle.scrollIntoView
---

# ElementHandle.scrollIntoView() method

Scrolls the element into view using either the automation protocol client or by calling element.scrollIntoView.

### Signature

```typescript
class ElementHandle {
  scrollIntoView(this: ElementHandle<Element>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.select
---

# ElementHandle.select() method

Triggers a `change` and `input` event once all the provided options have been selected. If there's no `<select>` element matching `selector`, the method throws an error.

### Signature

```typescript
class ElementHandle {
  select(...values: string[]): Promise<string[]>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

values

</td><td>

string\[\]

</td><td>

Values of options to select. If the `<select>` has the `multiple` attribute, all values are considered, otherwise only the first one is taken into account.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string\[\]&gt;

## Example

```ts
handle.select('blue'); // single selection
handle.select('red', 'green', 'blue'); // multiple selections
```

    ---
sidebar_label: ElementHandle.tap
---

# ElementHandle.tap() method

This method scrolls element into view if needed, and then uses [Touchscreen.tap()](./puppeteer.touchscreen.tap.md) to tap in the center of the element. If the element is detached from DOM, the method throws an error.

### Signature

```typescript
class ElementHandle {
  tap(this: ElementHandle<Element>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.toElement
---

# ElementHandle.toElement() method

Converts the current handle to the given element type.

### Signature

```typescript
class ElementHandle {
  toElement<K extends keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap>(
    tagName: K,
  ): Promise<HandleFor<ElementFor<K>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

tagName

</td><td>

K

</td><td>

The tag name of the desired element type.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;[ElementFor](./puppeteer.elementfor.md)&lt;K&gt;&gt;&gt;

## Exceptions

An error if the handle does not match. **The handle will not be automatically disposed.**

## Example

```ts
const element: ElementHandle<Element> = await page.$('.class-name-of-anchor');
// DO NOT DISPOSE `element`, this will be always be the same handle.
const anchor: ElementHandle<HTMLAnchorElement> = await element.toElement('a');
```

    ---
sidebar_label: ElementHandle.touchEnd
---

# ElementHandle.touchEnd() method

### Signature

```typescript
class ElementHandle {
  touchEnd(this: ElementHandle<Element>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.touchMove
---

# ElementHandle.touchMove() method

This method scrolls the element into view if needed, and then moves the touch to the center of the element.

### Signature

```typescript
class ElementHandle {
  touchMove(this: ElementHandle<Element>, touch?: TouchHandle): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
<tr><td>

touch

</td><td>

[TouchHandle](./puppeteer.touchhandle.md)

</td><td>

_(Optional)_ An optional [TouchHandle](./puppeteer.touchhandle.md). If provided, this touch will be moved. If not provided, the first active touch will be moved.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ElementHandle.touchStart
---

# ElementHandle.touchStart() method

This method scrolls the element into view if needed, and then starts a touch in the center of the element.

### Signature

```typescript
class ElementHandle {
  touchStart(this: ElementHandle<Element>): Promise<TouchHandle>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[TouchHandle](./puppeteer.touchhandle.md)&gt;

A [TouchHandle](./puppeteer.touchhandle.md) representing the touch that was started

    ---
sidebar_label: ElementHandle.type
---

# ElementHandle.type() method

Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

To press a special key, like `Control` or `ArrowDown`, use [ElementHandle.press()](./puppeteer.elementhandle.press.md).

### Signature

```typescript
class ElementHandle {
  type(text: string, options?: Readonly<KeyboardTypeOptions>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

text

</td><td>

string

</td><td>

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)&gt;

</td><td>

_(Optional)_ Delay in milliseconds. Defaults to 0.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example 1

```ts
await elementHandle.type('Hello'); // Types instantly
await elementHandle.type('World', {delay: 100}); // Types slower, like a user
```

## Example 2

An example of typing into a text field and then submitting the form:

```ts
const elementHandle = await page.$('input');
await elementHandle.type('some text');
await elementHandle.press('Enter');
```

    ---
sidebar_label: ElementHandle.uploadFile
---

# ElementHandle.uploadFile() method

Sets the value of an [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) to the given file paths.

### Signature

```typescript
class ElementHandle {
  abstract uploadFile(
    this: ElementHandle<HTMLInputElement>,
    ...paths: string[]
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLInputElement&gt;

</td><td>

</td></tr>
<tr><td>

paths

</td><td>

string\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

This will not validate whether the file paths exists. Also, if a path is relative, then it is resolved against the [current working directory](https://nodejs.org/api/process.html#process_process_cwd). For locals script connecting to remote chrome environments, paths must be absolute.

    ---
sidebar_label: ElementHandle.waitForSelector
---

# ElementHandle.waitForSelector() method

Wait for an element matching the given selector to appear in the current element.

Unlike [Frame.waitForSelector()](./puppeteer.frame.waitforselector.md), this method does not work across navigations or if the element is detached from DOM.

### Signature

```typescript
class ElementHandle {
  waitForSelector<Selector extends string>(
    selector: Selector,
    options?: WaitForSelectorOptions,
  ): Promise<ElementHandle<NodeFor<Selector>> | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

The selector to query and wait for.

</td></tr>
<tr><td>

options

</td><td>

[WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md)

</td><td>

_(Optional)_ Options for customizing waiting behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt; \| null&gt;

An element matching the given selector.

## Exceptions

Throws if an element matching the given selector doesn't appear.

## Example

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  let currentURL;
  page
    .mainFrame()
    .waitForSelector('img')
    .then(() => console.log('First URL with image: ' + currentURL));

  for (currentURL of [
    'https://example.com',
    'https://google.com',
    'https://bbc.com',
  ]) {
    await page.goto(currentURL);
  }
  await browser.close();
})();
```

    ---
sidebar_label: ElementScreenshotOptions
---

# ElementScreenshotOptions interface

### Signature

```typescript
export interface ElementScreenshotOptions extends ScreenshotOptions
```

**Extends:** [ScreenshotOptions](./puppeteer.screenshotoptions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="scrollintoview">scrollIntoView</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

`true`

</td></tr>
</tbody></table>

    ---
sidebar_label: ErrorCode
---

# ErrorCode type

### Signature

```typescript
export type ErrorCode =
  | 'aborted'
  | 'accessdenied'
  | 'addressunreachable'
  | 'blockedbyclient'
  | 'blockedbyresponse'
  | 'connectionaborted'
  | 'connectionclosed'
  | 'connectionfailed'
  | 'connectionrefused'
  | 'connectionreset'
  | 'internetdisconnected'
  | 'namenotresolved'
  | 'timedout'
  | 'failed';
```

    ---
sidebar_label: EvaluateFunc
---

# EvaluateFunc type

### Signature

```typescript
export type EvaluateFunc<T extends unknown[]> = (
  ...params: InnerParams<T>
) => Awaitable<unknown>;
```

**References:** [InnerParams](./puppeteer.innerparams.md), [Awaitable](./puppeteer.awaitable.md)

    ---
sidebar_label: EvaluateFuncWith
---

# EvaluateFuncWith type

### Signature

```typescript
export type EvaluateFuncWith<V, T extends unknown[]> = (
  ...params: [V, ...InnerParams<T>]
) => Awaitable<unknown>;
```

**References:** [InnerParams](./puppeteer.innerparams.md), [Awaitable](./puppeteer.awaitable.md)

    ---
sidebar_label: EventEmitter.emit
---

# EventEmitter.emit() method

Emit an event and call any associated listeners.

### Signature

```typescript
class EventEmitter {
  emit<Key extends keyof EventsWithWildcard<Events>>(
    type: Key,
    event: EventsWithWildcard<Events>[Key],
  ): boolean;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

the event you'd like to emit

</td></tr>
<tr><td>

event

</td><td>

[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

boolean

`true` if there are any listeners, `false` if there are not.

    ---
sidebar_label: EventEmitter.listenerCount
---

# EventEmitter.listenerCount() method

Gets the number of listeners for a given event.

### Signature

```typescript
class EventEmitter {
  listenerCount(type: keyof EventsWithWildcard<Events>): number;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

keyof [EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;

</td><td>

the event to get the listener count for

</td></tr>
</tbody></table>

**Returns:**

number

the number of listeners bound to the given event

    ---
sidebar_label: EventEmitter
---

# EventEmitter class

The EventEmitter class that many Puppeteer classes extend.

### Signature

```typescript
export declare class EventEmitter<Events extends Record<EventType, unknown>> implements CommonEventEmitter<EventsWithWildcard<Events>>
```

**Implements:** [CommonEventEmitter](./puppeteer.commoneventemitter.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;&gt;

## Remarks

This allows you to listen to events that Puppeteer classes fire and act accordingly. Therefore you'll mostly use [on](./puppeteer.eventemitter.on.md) and [off](./puppeteer.eventemitter.off.md) to bind and unbind to event listeners.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `EventEmitter` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="emit">[emit(type, event)](./puppeteer.eventemitter.emit.md)</span>

</td><td>

</td><td>

Emit an event and call any associated listeners.

</td></tr>
<tr><td>

<span id="listenercount">[listenerCount(type)](./puppeteer.eventemitter.listenercount.md)</span>

</td><td>

</td><td>

Gets the number of listeners for a given event.

</td></tr>
<tr><td>

<span id="off">[off(type, handler)](./puppeteer.eventemitter.off.md)</span>

</td><td>

</td><td>

Remove an event listener from firing.

</td></tr>
<tr><td>

<span id="on">[on(type, handler)](./puppeteer.eventemitter.on.md)</span>

</td><td>

</td><td>

Bind an event listener to fire when an event occurs.

</td></tr>
<tr><td>

<span id="once">[once(type, handler)](./puppeteer.eventemitter.once.md)</span>

</td><td>

</td><td>

Like `on` but the listener will only be fired once and then it will be removed.

</td></tr>
<tr><td>

<span id="removealllisteners">[removeAllListeners(type)](./puppeteer.eventemitter.removealllisteners.md)</span>

</td><td>

</td><td>

Removes all listeners. If given an event argument, it will remove only listeners for that event.

</td></tr>
</tbody></table>

    ---
sidebar_label: EventEmitter.off
---

# EventEmitter.off() method

Remove an event listener from firing.

### Signature

```typescript
class EventEmitter {
  off<Key extends keyof EventsWithWildcard<Events>>(
    type: Key,
    handler?: Handler<EventsWithWildcard<Events>[Key]>,
  ): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

the event type you'd like to stop listening to.

</td></tr>
<tr><td>

handler

</td><td>

[Handler](./puppeteer.handler.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\]&gt;

</td><td>

_(Optional)_ the function that should be removed.

</td></tr>
</tbody></table>

**Returns:**

this

`this` to enable you to chain method calls.

    ---
sidebar_label: EventEmitter.on
---

# EventEmitter.on() method

Bind an event listener to fire when an event occurs.

### Signature

```typescript
class EventEmitter {
  on<Key extends keyof EventsWithWildcard<Events>>(
    type: Key,
    handler: Handler<EventsWithWildcard<Events>[Key]>,
  ): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

the event type you'd like to listen to. Can be a string or symbol.

</td></tr>
<tr><td>

handler

</td><td>

[Handler](./puppeteer.handler.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\]&gt;

</td><td>

the function to be called when the event occurs.

</td></tr>
</tbody></table>

**Returns:**

this

`this` to enable you to chain method calls.

    ---
sidebar_label: EventEmitter.once
---

# EventEmitter.once() method

Like `on` but the listener will only be fired once and then it will be removed.

### Signature

```typescript
class EventEmitter {
  once<Key extends keyof EventsWithWildcard<Events>>(
    type: Key,
    handler: Handler<EventsWithWildcard<Events>[Key]>,
  ): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Key

</td><td>

the event you'd like to listen to

</td></tr>
<tr><td>

handler

</td><td>

[Handler](./puppeteer.handler.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\]&gt;

</td><td>

the handler function to run when the event occurs

</td></tr>
</tbody></table>

**Returns:**

this

`this` to enable you to chain method calls.

    ---
sidebar_label: EventEmitter.removeAllListeners
---

# EventEmitter.removeAllListeners() method

Removes all listeners. If given an event argument, it will remove only listeners for that event.

### Signature

```typescript
class EventEmitter {
  removeAllListeners(type?: keyof EventsWithWildcard<Events>): this;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

keyof [EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;

</td><td>

_(Optional)_ the event to remove listeners for.

</td></tr>
</tbody></table>

**Returns:**

this

`this` to enable you to chain method calls.

    ---
sidebar_label: EventsWithWildcard
---

# EventsWithWildcard type

### Signature

```typescript
export type EventsWithWildcard<Events extends Record<EventType, unknown>> =
  Events & {
    '*': Events[keyof Events];
  };
```

**References:** [EventType](./puppeteer.eventtype.md)

    ---
sidebar_label: EventType
---

# EventType type

### Signature

```typescript
export type EventType = string | symbol;
```

    ---
sidebar_label: executablePath
---

# executablePath variable

### Signature

```typescript
executablePath: {
    (channel: PuppeteerCore.ChromeReleaseChannel): string;
    (options: PuppeteerCore.LaunchOptions): string;
    (): string;
}
```

    ---
sidebar_label: ExperimentsConfiguration
---

# ExperimentsConfiguration type

Defines experiment options for Puppeteer.

See individual properties for more information.

### Signature

```typescript
export type ExperimentsConfiguration = Record<string, never>;
```

    ---
sidebar_label: ExtensionTransport.close
---

# ExtensionTransport.close() method

### Signature

```typescript
class ExtensionTransport {
  close(): void;
}
```

**Returns:**

void

    ---
sidebar_label: ExtensionTransport.connectTab
---

# ExtensionTransport.connectTab() method

### Signature

```typescript
class ExtensionTransport {
  static connectTab(tabId: number): Promise<ExtensionTransport>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

tabId

</td><td>

number

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ExtensionTransport](./puppeteer.extensiontransport.md)&gt;

    ---
sidebar_label: ExtensionTransport
---

# ExtensionTransport class

Experimental ExtensionTransport allows establishing a connection via chrome.debugger API if Puppeteer runs in an extension. Since Chrome DevTools Protocol is restricted for extensions, the transport implements missing commands and events.

### Signature

```typescript
export declare class ExtensionTransport implements ConnectionTransport
```

**Implements:** [ConnectionTransport](./puppeteer.connectiontransport.md)

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ExtensionTransport` class.

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="onclose">onclose</span>

</td><td>

`optional`

</td><td>

() =&gt; void

</td><td>

</td></tr>
<tr><td>

<span id="onmessage">onmessage</span>

</td><td>

`optional`

</td><td>

(message: string) =&gt; void

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="close">[close()](./puppeteer.extensiontransport.close.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="connecttab">[connectTab(tabId)](./puppeteer.extensiontransport.connecttab.md)</span>

</td><td>

`static`

</td><td>

</td></tr>
<tr><td>

<span id="send">[send(message)](./puppeteer.extensiontransport.send.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ExtensionTransport.send
---

# ExtensionTransport.send() method

### Signature

```typescript
class ExtensionTransport {
  send(message: string): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

message

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

void

    ---
sidebar_label: FileChooser.accept
---

# FileChooser.accept() method

Accept the file chooser request with the given file paths.

### Signature

```typescript
class FileChooser {
  accept(paths: string[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

paths

</td><td>

string\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

This will not validate whether the file paths exists. Also, if a path is relative, then it is resolved against the [current working directory](https://nodejs.org/api/process.html#process_process_cwd). For locals script connecting to remote chrome environments, paths must be absolute.

    ---
sidebar_label: FileChooser.cancel
---

# FileChooser.cancel() method

Closes the file chooser without selecting any files.

### Signature

```typescript
class FileChooser {
  cancel(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: FileChooser.isMultiple
---

# FileChooser.isMultiple() method

Whether file chooser allow for [multiple](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-multiple) file selection.

### Signature

```typescript
class FileChooser {
  isMultiple(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: FileChooser
---

# FileChooser class

File choosers let you react to the page requesting for a file.

### Signature

```typescript
export declare class FileChooser
```

## Remarks

`FileChooser` instances are returned via the [Page.waitForFileChooser()](./puppeteer.page.waitforfilechooser.md) method.

In browsers, only one file chooser can be opened at a time. All file choosers must be accepted or canceled. Not doing so will prevent subsequent file choosers from appearing.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `FileChooser` class.

## Example

```ts
const [fileChooser] = await Promise.all([
  page.waitForFileChooser(),
  page.click('#upload-file-button'), // some button that triggers file selection
]);
await fileChooser.accept(['/tmp/myfile.pdf']);
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="accept">[accept(paths)](./puppeteer.filechooser.accept.md)</span>

</td><td>

</td><td>

Accept the file chooser request with the given file paths.

**Remarks:**

This will not validate whether the file paths exists. Also, if a path is relative, then it is resolved against the [current working directory](https://nodejs.org/api/process.html#process_process_cwd). For locals script connecting to remote chrome environments, paths must be absolute.

</td></tr>
<tr><td>

<span id="cancel">[cancel()](./puppeteer.filechooser.cancel.md)</span>

</td><td>

</td><td>

Closes the file chooser without selecting any files.

</td></tr>
<tr><td>

<span id="ismultiple">[isMultiple()](./puppeteer.filechooser.ismultiple.md)</span>

</td><td>

</td><td>

Whether file chooser allow for [multiple](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-multiple) file selection.

</td></tr>
</tbody></table>

    ---
sidebar_label: FirefoxSettings
---

# FirefoxSettings interface

### Signature

```typescript
export interface FirefoxSettings
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="downloadbaseurl">downloadBaseUrl</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Specifies the URL prefix that is used to download the browser.

Can be overridden by `PUPPETEER_FIREFOX_DOWNLOAD_BASE_URL`.

**Remarks:**

This must include the protocol and may even need a path prefix. This must **not** include a trailing slash similar to the default.

</td><td>

https://archive.mozilla.org/pub/firefox/releases

</td></tr>
<tr><td>

<span id="skipdownload">skipDownload</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Tells Puppeteer to not download the browser during installation.

Can be overridden by `PUPPETEER_FIREFOX_SKIP_DOWNLOAD`.

</td><td>

true

</td></tr>
<tr><td>

<span id="version">version</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Specifies a certain version of the browser you'd like Puppeteer to use.

Can be overridden by `PUPPETEER_FIREFOX_VERSION`.

See [puppeteer.launch](./puppeteer.puppeteernode.launch.md) on how executable path is inferred.

</td><td>

The pinned browser version supported by the current Puppeteer version.

</td></tr>
</tbody></table>

    ---
sidebar_label: FlattenHandle
---

# FlattenHandle type

### Signature

```typescript
export type FlattenHandle<T> = T extends HandleOr<infer U> ? U : never;
```

**References:** [HandleOr](./puppeteer.handleor.md)

    ---
sidebar_label: Frame.$
---

# Frame.$() method

Queries the frame for an element matching the given selector.

### Signature

```typescript
class Frame {
  $<Selector extends string>(
    selector: Selector,
  ): Promise<ElementHandle<NodeFor<Selector>> | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt; \| null&gt;

A [element handle](./puppeteer.elementhandle.md) to the first element matching the given selector. Otherwise, `null`.

    ---
sidebar_label: Frame.$$
---

# Frame.$$() method

Queries the frame for all elements matching the given selector.

### Signature

```typescript
class Frame {
  $$<Selector extends string>(
    selector: Selector,
    options?: QueryOptions,
  ): Promise<Array<ElementHandle<NodeFor<Selector>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

options

</td><td>

[QueryOptions](./puppeteer.queryoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Array&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt;&gt;&gt;

An array of [element handles](./puppeteer.elementhandle.md) that point to elements matching the given selector.

    ---
sidebar_label: Frame.$$eval
---

# Frame.$$eval() method

Runs the given function on an array of elements matching the given selector in the frame.

If the given function returns a promise, then this method will wait till the promise resolves.

### Signature

```typescript
class Frame {
  $$eval<
    Selector extends string,
    Params extends unknown[],
    Func extends EvaluateFuncWith<
      Array<NodeFor<Selector>>,
      Params
    > = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
  >(
    selector: Selector,
    pageFunction: string | Func,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

pageFunction

</td><td>

string \| Func

</td><td>

The function to be evaluated in the frame's context. An array of elements matching the given selector will be passed to the function as its first argument.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

Additional arguments to pass to `pageFunction`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

A promise to the result of the function.

## Example

```ts
const divsCounts = await frame.$$eval('div', divs => divs.length);
```

    ---
sidebar_label: Frame.$eval
---

# Frame.$eval() method

Runs the given function on the first element matching the given selector in the frame.

If the given function returns a promise, then this method will wait till the promise resolves.

### Signature

```typescript
class Frame {
  $eval<
    Selector extends string,
    Params extends unknown[],
    Func extends EvaluateFuncWith<NodeFor<Selector>, Params> = EvaluateFuncWith<
      NodeFor<Selector>,
      Params
    >,
  >(
    selector: Selector,
    pageFunction: string | Func,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

pageFunction

</td><td>

string \| Func

</td><td>

The function to be evaluated in the frame's context. The first element matching the selector will be passed to the function as its first argument.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

Additional arguments to pass to `pageFunction`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

A promise to the result of the function.

## Example

```ts
const searchValue = await frame.$eval('#search', el => el.value);
```

    ---
sidebar_label: Frame.addScriptTag
---

# Frame.addScriptTag() method

Adds a `<script>` tag into the page with the desired url or content.

### Signature

```typescript
class Frame {
  addScriptTag(
    options: FrameAddScriptTagOptions,
  ): Promise<ElementHandle<HTMLScriptElement>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md)

</td><td>

Options for the script.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLScriptElement&gt;&gt;

An [element handle](./puppeteer.elementhandle.md) to the injected `<script>` element.

    ---
sidebar_label: Frame.addStyleTag
---

# Frame.addStyleTag() method

<h2 id="addStyleTag">addStyleTag(): Promise&lt;ElementHandle&lt;HTMLStyleElement&gt;&gt;</h2>

Adds a `HTMLStyleElement` into the frame with the desired URL

### Signature

```typescript
class Frame {
  addStyleTag(
    options: Omit<FrameAddStyleTagOptions, 'url'>,
  ): Promise<ElementHandle<HTMLStyleElement>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Omit&lt;[FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md), 'url'&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLStyleElement&gt;&gt;

An [element handle](./puppeteer.elementhandle.md) to the loaded `<style>` element.

<h2 id="addStyleTag-1">addStyleTag(): Promise&lt;ElementHandle&lt;HTMLLinkElement&gt;&gt;</h2>

Adds a `HTMLLinkElement` into the frame with the desired URL

### Signature

```typescript
class Frame {
  addStyleTag(
    options: FrameAddStyleTagOptions,
  ): Promise<ElementHandle<HTMLLinkElement>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLLinkElement&gt;&gt;

An [element handle](./puppeteer.elementhandle.md) to the loaded `<link>` element.

    ---
sidebar_label: Frame.childFrames
---

# Frame.childFrames() method

An array of child frames.

### Signature

```typescript
class Frame {
  abstract childFrames(): Frame[];
}
```

**Returns:**

[Frame](./puppeteer.frame.md)\[\]

    ---
sidebar_label: Frame.click
---

# Frame.click() method

Clicks the first element found that matches `selector`.

### Signature

```typescript
class Frame {
  click(selector: string, options?: Readonly<ClickOptions>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

The selector to query for.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[ClickOptions](./puppeteer.clickoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

If `click()` triggers a navigation event and there's a separate `page.waitForNavigation()` promise to be resolved, you may end up with a race condition that yields unexpected results. The correct pattern for click and wait for navigation is the following:

```ts
const [response] = await Promise.all([
  page.waitForNavigation(waitOptions),
  frame.click(selector, clickOptions),
]);
```

    ---
sidebar_label: Frame.content
---

# Frame.content() method

The full HTML contents of the frame, including the DOCTYPE.

### Signature

```typescript
class Frame {
  content(): Promise<string>;
}
```

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: Frame.evaluate
---

# Frame.evaluate() method

Behaves identically to [Page.evaluate()](./puppeteer.page.evaluate.md) except it's run within the context of this frame.

See [Page.evaluate()](./puppeteer.page.evaluate.md) for details.

### Signature

```typescript
class Frame {
  evaluate<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(
    pageFunction: Func | string,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

    ---
sidebar_label: Frame.evaluateHandle
---

# Frame.evaluateHandle() method

Behaves identically to [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md) except it's run within the context of this frame.

See [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md) for details.

### Signature

```typescript
class Frame {
  evaluateHandle<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(
    pageFunction: Func | string,
    ...args: Params
  ): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;&gt;

    ---
sidebar_label: Frame.focus
---

# Frame.focus() method

Focuses the first element that matches the `selector`.

### Signature

```typescript
class Frame {
  focus(selector: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

The selector to query for.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Exceptions

Throws if there's no element matching `selector`.

    ---
sidebar_label: Frame.frameElement
---

# Frame.frameElement() method

### Signature

```typescript
class Frame {
  frameElement(): Promise<HandleFor<HTMLIFrameElement> | null>;
}
```

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;HTMLIFrameElement&gt; \| null&gt;

The frame element associated with this frame (if any).

    ---
sidebar_label: Frame.goto
---

# Frame.goto() method

Navigates the frame or page to the given `url`.

### Signature

```typescript
class Frame {
  abstract goto(
    url: string,
    options?: GoToOptions,
  ): Promise<HTTPResponse | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

url

</td><td>

string

</td><td>

URL to navigate the frame to. The URL should include scheme, e.g. `https://`

</td></tr>
<tr><td>

options

</td><td>

[GoToOptions](./puppeteer.gotooptions.md)

</td><td>

_(Optional)_ Options to configure waiting behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md) \| null&gt;

A promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.

## Exceptions

If:

- there's an SSL error (e.g. in case of self-signed certificates).

- target URL is invalid.

- the timeout is exceeded during navigation.

- the remote server does not respond or is unreachable.

- the main resource failed to load.

## Remarks

Navigation to `about:blank` or navigation to the same URL with a different hash will succeed and return `null`.

:::warning

Headless shell mode doesn't support navigation to a PDF document. See the [upstream issue](https://crbug.com/761295).

:::

In headless shell, this method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [HTTPResponse.status()](./puppeteer.httpresponse.status.md).

    ---
sidebar_label: Frame.hover
---

# Frame.hover() method

Hovers the pointer over the center of the first element that matches the `selector`.

### Signature

```typescript
class Frame {
  hover(selector: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

The selector to query for.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Exceptions

Throws if there's no element matching `selector`.

    ---
sidebar_label: Frame.isDetached
---

# Frame.isDetached() method

> Warning: This API is now obsolete.
>
> Use the `detached` getter.

Is`true` if the frame has been detached. Otherwise, `false`.

### Signature

```typescript
class Frame {
  isDetached(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: Frame.locator
---

# Frame.locator() method

<h2 id="locator">locator(): Locator&lt;NodeFor&lt;Selector&gt;&gt;</h2>

Creates a locator for the provided selector. See [Locator](./puppeteer.locator.md) for details and supported actions.

### Signature

```typescript
class Frame {
  locator<Selector extends string>(
    selector: Selector,
  ): Locator<NodeFor<Selector>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt;

<h2 id="locator-1">locator(): Locator&lt;Ret&gt;</h2>

Creates a locator for the provided function. See [Locator](./puppeteer.locator.md) for details and supported actions.

### Signature

```typescript
class Frame {
  locator<Ret>(func: () => Awaitable<Ret>): Locator<Ret>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

func

</td><td>

() =&gt; [Awaitable](./puppeteer.awaitable.md)&lt;Ret&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;Ret&gt;

    ---
sidebar_label: Frame
---

# Frame class

Represents a DOM frame.

To understand frames, you can think of frames as `<iframe>` elements. Just like iframes, frames can be nested, and when JavaScript is executed in a frame, the JavaScript does not affect frames inside the ambient frame the JavaScript executes in.

### Signature

```typescript
export declare abstract class Frame extends EventEmitter<FrameEvents>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[FrameEvents](./puppeteer.frameevents.md)&gt;

## Remarks

Frame lifecycles are controlled by three events that are all dispatched on the parent [page](./puppeteer.frame.page.md):

- [PageEvent.FrameAttached](./puppeteer.pageevent.md) - [PageEvent.FrameNavigated](./puppeteer.pageevent.md) - [PageEvent.FrameDetached](./puppeteer.pageevent.md)

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Frame` class.

## Example 1

At any point in time, [pages](./puppeteer.page.md) expose their current frame tree via the [Page.mainFrame()](./puppeteer.page.mainframe.md) and [Frame.childFrames()](./puppeteer.frame.childframes.md) methods.

## Example 2

An example of dumping frame tree:

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://www.google.com/chrome/browser/canary.html');
  dumpFrameTree(page.mainFrame(), '');
  await browser.close();

  function dumpFrameTree(frame, indent) {
    console.log(indent + frame.url());
    for (const child of frame.childFrames()) {
      dumpFrameTree(child, indent + '  ');
    }
  }
})();
```

## Example 3

An example of getting text from an iframe element:

```ts
const frames = page.frames();
let frame = null;
for (const currentFrame of frames) {
  const frameElement = await currentFrame.frameElement();
  const name = await frameElement.evaluate(el => el.getAttribute('name'));
  if (name === 'myframe') {
    frame = currentFrame;
    break;
  }
}
if (frame) {
  const text = await frame.$eval('.selector', element => element.textContent);
  console.log(text);
} else {
  console.error('Frame with name "myframe" not found.');
}
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="detached">detached</span>

</td><td>

`readonly`

</td><td>

boolean

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_">[$(selector)](./puppeteer.frame._.md)</span>

</td><td>

</td><td>

Queries the frame for an element matching the given selector.

</td></tr>
<tr><td>

<span id="__">[$$(selector, options)](./puppeteer.frame.__.md)</span>

</td><td>

</td><td>

Queries the frame for all elements matching the given selector.

</td></tr>
<tr><td>

<span id="__eval">[$$eval(selector, pageFunction, args)](./puppeteer.frame.__eval.md)</span>

</td><td>

</td><td>

Runs the given function on an array of elements matching the given selector in the frame.

If the given function returns a promise, then this method will wait till the promise resolves.

</td></tr>
<tr><td>

<span id="_eval">[$eval(selector, pageFunction, args)](./puppeteer.frame._eval.md)</span>

</td><td>

</td><td>

Runs the given function on the first element matching the given selector in the frame.

If the given function returns a promise, then this method will wait till the promise resolves.

</td></tr>
<tr><td>

<span id="addscripttag">[addScriptTag(options)](./puppeteer.frame.addscripttag.md)</span>

</td><td>

</td><td>

Adds a `<script>` tag into the page with the desired url or content.

</td></tr>
<tr><td>

<span id="addstyletag">[addStyleTag(options)](./puppeteer.frame.addstyletag.md)</span>

</td><td>

</td><td>

Adds a `HTMLStyleElement` into the frame with the desired URL

</td></tr>
<tr><td>

<span id="addstyletag">[addStyleTag(options)](./puppeteer.frame.addstyletag.md)</span>

</td><td>

</td><td>

Adds a `HTMLLinkElement` into the frame with the desired URL

</td></tr>
<tr><td>

<span id="childframes">[childFrames()](./puppeteer.frame.childframes.md)</span>

</td><td>

</td><td>

An array of child frames.

</td></tr>
<tr><td>

<span id="click">[click(selector, options)](./puppeteer.frame.click.md)</span>

</td><td>

</td><td>

Clicks the first element found that matches `selector`.

**Remarks:**

If `click()` triggers a navigation event and there's a separate `page.waitForNavigation()` promise to be resolved, you may end up with a race condition that yields unexpected results. The correct pattern for click and wait for navigation is the following:

```ts
const [response] = await Promise.all([
  page.waitForNavigation(waitOptions),
  frame.click(selector, clickOptions),
]);
```

</td></tr>
<tr><td>

<span id="content">[content()](./puppeteer.frame.content.md)</span>

</td><td>

</td><td>

The full HTML contents of the frame, including the DOCTYPE.

</td></tr>
<tr><td>

<span id="evaluate">[evaluate(pageFunction, args)](./puppeteer.frame.evaluate.md)</span>

</td><td>

</td><td>

Behaves identically to [Page.evaluate()](./puppeteer.page.evaluate.md) except it's run within the context of this frame.

See [Page.evaluate()](./puppeteer.page.evaluate.md) for details.

</td></tr>
<tr><td>

<span id="evaluatehandle">[evaluateHandle(pageFunction, args)](./puppeteer.frame.evaluatehandle.md)</span>

</td><td>

</td><td>

Behaves identically to [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md) except it's run within the context of this frame.

See [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md) for details.

</td></tr>
<tr><td>

<span id="focus">[focus(selector)](./puppeteer.frame.focus.md)</span>

</td><td>

</td><td>

Focuses the first element that matches the `selector`.

</td></tr>
<tr><td>

<span id="frameelement">[frameElement()](./puppeteer.frame.frameelement.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="goto">[goto(url, options)](./puppeteer.frame.goto.md)</span>

</td><td>

</td><td>

Navigates the frame or page to the given `url`.

**Remarks:**

Navigation to `about:blank` or navigation to the same URL with a different hash will succeed and return `null`.

:::warning

Headless shell mode doesn't support navigation to a PDF document. See the [upstream issue](https://crbug.com/761295).

:::

In headless shell, this method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [HTTPResponse.status()](./puppeteer.httpresponse.status.md).

</td></tr>
<tr><td>

<span id="hover">[hover(selector)](./puppeteer.frame.hover.md)</span>

</td><td>

</td><td>

Hovers the pointer over the center of the first element that matches the `selector`.

</td></tr>
<tr><td>

<span id="isdetached">[isDetached()](./puppeteer.frame.isdetached.md)</span>

</td><td>

`deprecated`

</td><td>

Is`true` if the frame has been detached. Otherwise, `false`.

**Deprecated:**

Use the `detached` getter.

</td></tr>
<tr><td>

<span id="locator">[locator(selector)](./puppeteer.frame.locator.md)</span>

</td><td>

</td><td>

Creates a locator for the provided selector. See [Locator](./puppeteer.locator.md) for details and supported actions.

</td></tr>
<tr><td>

<span id="locator">[locator(func)](./puppeteer.frame.locator.md)</span>

</td><td>

</td><td>

Creates a locator for the provided function. See [Locator](./puppeteer.locator.md) for details and supported actions.

</td></tr>
<tr><td>

<span id="name">[name()](./puppeteer.frame.name.md)</span>

</td><td>

`deprecated`

</td><td>

The frame's `name` attribute as specified in the tag.

**Deprecated:**

Use

```ts
const element = await frame.frameElement();
const nameOrId = await element.evaluate(frame => frame.name ?? frame.id);
```

**Remarks:**

This value is calculated once when the frame is created, and will not update if the attribute is changed later.

</td></tr>
<tr><td>

<span id="page">[page()](./puppeteer.frame.page.md)</span>

</td><td>

</td><td>

The page associated with the frame.

</td></tr>
<tr><td>

<span id="parentframe">[parentFrame()](./puppeteer.frame.parentframe.md)</span>

</td><td>

</td><td>

The parent frame, if any. Detached and main frames return `null`.

</td></tr>
<tr><td>

<span id="select">[select(selector, values)](./puppeteer.frame.select.md)</span>

</td><td>

</td><td>

Selects a set of value on the first `<select>` element that matches the `selector`.

</td></tr>
<tr><td>

<span id="setcontent">[setContent(html, options)](./puppeteer.frame.setcontent.md)</span>

</td><td>

</td><td>

Set the content of the frame.

</td></tr>
<tr><td>

<span id="tap">[tap(selector)](./puppeteer.frame.tap.md)</span>

</td><td>

</td><td>

Taps the first element that matches the `selector`.

</td></tr>
<tr><td>

<span id="title">[title()](./puppeteer.frame.title.md)</span>

</td><td>

</td><td>

The frame's title.

</td></tr>
<tr><td>

<span id="type">[type(selector, text, options)](./puppeteer.frame.type.md)</span>

</td><td>

</td><td>

Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

**Remarks:**

To press a special key, like `Control` or `ArrowDown`, use [Keyboard.press()](./puppeteer.keyboard.press.md).

</td></tr>
<tr><td>

<span id="url">[url()](./puppeteer.frame.url.md)</span>

</td><td>

</td><td>

The frame's URL.

</td></tr>
<tr><td>

<span id="waitforfunction">[waitForFunction(pageFunction, options, args)](./puppeteer.frame.waitforfunction.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="waitfornavigation">[waitForNavigation(options)](./puppeteer.frame.waitfornavigation.md)</span>

</td><td>

</td><td>

Waits for the frame to navigate. It is useful for when you run code which will indirectly cause the frame to navigate.

Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered a navigation.

</td></tr>
<tr><td>

<span id="waitforselector">[waitForSelector(selector, options)](./puppeteer.frame.waitforselector.md)</span>

</td><td>

</td><td>

Waits for an element matching the given selector to appear in the frame.

This method works across navigations.

</td></tr>
</tbody></table>

    ---
sidebar_label: Frame.name
---

# Frame.name() method

> Warning: This API is now obsolete.
>
> Use
>
> ```ts
> const element = await frame.frameElement();
> const nameOrId = await element.evaluate(frame => frame.name ?? frame.id);
> ```

The frame's `name` attribute as specified in the tag.

### Signature

```typescript
class Frame {
  name(): string;
}
```

**Returns:**

string

## Remarks

This value is calculated once when the frame is created, and will not update if the attribute is changed later.

    ---
sidebar_label: Frame.page
---

# Frame.page() method

The page associated with the frame.

### Signature

```typescript
class Frame {
  abstract page(): Page;
}
```

**Returns:**

[Page](./puppeteer.page.md)

    ---
sidebar_label: Frame.parentFrame
---

# Frame.parentFrame() method

The parent frame, if any. Detached and main frames return `null`.

### Signature

```typescript
class Frame {
  abstract parentFrame(): Frame | null;
}
```

**Returns:**

[Frame](./puppeteer.frame.md) \| null

    ---
sidebar_label: Frame.select
---

# Frame.select() method

Selects a set of value on the first `<select>` element that matches the `selector`.

### Signature

```typescript
class Frame {
  select(selector: string, ...values: string[]): Promise<string[]>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

The selector to query for.

</td></tr>
<tr><td>

values

</td><td>

string\[\]

</td><td>

The array of values to select. If the `<select>` has the `multiple` attribute, all values are considered, otherwise only the first one is taken into account.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string\[\]&gt;

the list of values that were successfully selected.

## Exceptions

Throws if there's no `<select>` matching `selector`.

## Example

```ts
frame.select('select#colors', 'blue'); // single selection
frame.select('select#colors', 'red', 'green', 'blue'); // multiple selections
```

    ---
sidebar_label: Frame.setContent
---

# Frame.setContent() method

Set the content of the frame.

### Signature

```typescript
class Frame {
  abstract setContent(html: string, options?: WaitForOptions): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

html

</td><td>

string

</td><td>

HTML markup to assign to the page.

</td></tr>
<tr><td>

options

</td><td>

[WaitForOptions](./puppeteer.waitforoptions.md)

</td><td>

_(Optional)_ Options to configure how long before timing out and at what point to consider the content setting successful.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Frame.tap
---

# Frame.tap() method

Taps the first element that matches the `selector`.

### Signature

```typescript
class Frame {
  tap(selector: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

The selector to query for.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Exceptions

Throws if there's no element matching `selector`.

    ---
sidebar_label: Frame.title
---

# Frame.title() method

The frame's title.

### Signature

```typescript
class Frame {
  title(): Promise<string>;
}
```

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: Frame.type
---

# Frame.type() method

Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

### Signature

```typescript
class Frame {
  type(
    selector: string,
    text: string,
    options?: Readonly<KeyboardTypeOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

the selector for the element to type into. If there are multiple the first will be used.

</td></tr>
<tr><td>

text

</td><td>

string

</td><td>

text to type into the element

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)&gt;

</td><td>

_(Optional)_ takes one option, `delay`, which sets the time to wait between key presses in milliseconds. Defaults to `0`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

To press a special key, like `Control` or `ArrowDown`, use [Keyboard.press()](./puppeteer.keyboard.press.md).

## Example

```ts
await frame.type('#mytextarea', 'Hello'); // Types instantly
await frame.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a user
```

    ---
sidebar_label: Frame.url
---

# Frame.url() method

The frame's URL.

### Signature

```typescript
class Frame {
  abstract url(): string;
}
```

**Returns:**

string

    ---
sidebar_label: Frame.waitForFunction
---

# Frame.waitForFunction() method

### Signature

```typescript
class Frame {
  waitForFunction<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(
    pageFunction: Func | string,
    options?: FrameWaitForFunctionOptions,
    ...args: Params
  ): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

the function to evaluate in the frame context.

</td></tr>
<tr><td>

options

</td><td>

[FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md)

</td><td>

_(Optional)_ options to configure the polling method and timeout.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

arguments to pass to the `pageFunction`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;&gt;

the promise which resolve when the `pageFunction` returns a truthy value.

## Example

The `waitForFunction` can be used to observe viewport size change:

```ts
import puppeteer from 'puppeteer';

(async () => {
.  const browser = await puppeteer.launch();
.  const page = await browser.newPage();
.  const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');
.  page.setViewport({width: 50, height: 50});
.  await watchDog;
.  await browser.close();
})();
```

To pass arguments from Node.js to the predicate of `page.waitForFunction` function:

```ts
const selector = '.foo';
await frame.waitForFunction(
  selector => !!document.querySelector(selector),
  {}, // empty options object
  selector,
);
```

    ---
sidebar_label: Frame.waitForNavigation
---

# Frame.waitForNavigation() method

Waits for the frame to navigate. It is useful for when you run code which will indirectly cause the frame to navigate.

Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered a navigation.

### Signature

```typescript
class Frame {
  abstract waitForNavigation(
    options?: WaitForOptions,
  ): Promise<HTTPResponse | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitForOptions](./puppeteer.waitforoptions.md)

</td><td>

_(Optional)_ Options to configure waiting behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md) \| null&gt;

A promise which resolves to the main resource response.

## Example

```ts
const [response] = await Promise.all([
  // The navigation promise resolves after navigation has finished
  frame.waitForNavigation(),
  // Clicking the link will indirectly cause a navigation
  frame.click('a.my-link'),
]);
```

    ---
sidebar_label: Frame.waitForSelector
---

# Frame.waitForSelector() method

Waits for an element matching the given selector to appear in the frame.

This method works across navigations.

### Signature

```typescript
class Frame {
  waitForSelector<Selector extends string>(
    selector: Selector,
    options?: WaitForSelectorOptions,
  ): Promise<ElementHandle<NodeFor<Selector>> | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

The selector to query and wait for.

</td></tr>
<tr><td>

options

</td><td>

[WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md)

</td><td>

_(Optional)_ Options for customizing waiting behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt; \| null&gt;

An element matching the given selector.

## Exceptions

Throws if an element matching the given selector doesn't appear.

## Example

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  let currentURL;
  page
    .mainFrame()
    .waitForSelector('img')
    .then(() => console.log('First URL with image: ' + currentURL));

  for (currentURL of [
    'https://example.com',
    'https://google.com',
    'https://bbc.com',
  ]) {
    await page.goto(currentURL);
  }
  await browser.close();
})();
```

    ---
sidebar_label: FrameAddScriptTagOptions
---

# FrameAddScriptTagOptions interface

### Signature

```typescript
export interface FrameAddScriptTagOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="content">content</span>

</td><td>

`optional`

</td><td>

string

</td><td>

JavaScript to be injected into the frame.

</td><td>

</td></tr>
<tr><td>

<span id="id">id</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Sets the `id` of the script.

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Path to a JavaScript file to be injected into the frame.

**Remarks:**

If `path` is a relative path, it is resolved relative to the current working directory (`process.cwd()` in Node.js).

</td><td>

</td></tr>
<tr><td>

<span id="type">type</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Sets the `type` of the script. Use `module` in order to load an ES2015 module.

</td><td>

</td></tr>
<tr><td>

<span id="url">url</span>

</td><td>

`optional`

</td><td>

string

</td><td>

URL of the script to be added.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: FrameAddStyleTagOptions
---

# FrameAddStyleTagOptions interface

### Signature

```typescript
export interface FrameAddStyleTagOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="content">content</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Raw CSS content to be injected into the frame.

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

string

</td><td>

The path to a CSS file to be injected into the frame.

**Remarks:**

If `path` is a relative path, it is resolved relative to the current working directory (`process.cwd()` in Node.js).

</td><td>

</td></tr>
<tr><td>

<span id="url">url</span>

</td><td>

`optional`

</td><td>

string

</td><td>

the URL of the CSS file to be added.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: FrameEvents
---

# FrameEvents interface

### Signature

```typescript
export interface FrameEvents extends Record<EventType, unknown>
```

**Extends:** Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;

    ---
sidebar_label: FrameWaitForFunctionOptions
---

# FrameWaitForFunctionOptions interface

### Signature

```typescript
export interface FrameWaitForFunctionOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="polling">polling</span>

</td><td>

`optional`

</td><td>

'raf' \| 'mutation' \| number

</td><td>

An interval at which the `pageFunction` is executed, defaults to `raf`. If `polling` is a number, then it is treated as an interval in milliseconds at which the function would be executed. If `polling` is a string, then it can be one of the following values:

- `raf` - to constantly execute `pageFunction` in `requestAnimationFrame` callback. This is the tightest polling mode which is suitable to observe styling changes.

- `mutation` - to execute `pageFunction` on every DOM mutation.

</td><td>

</td></tr>
<tr><td>

<span id="signal">signal</span>

</td><td>

`optional`

</td><td>

AbortSignal

</td><td>

A signal object that allows you to cancel a waitForFunction call.

</td><td>

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Maximum time to wait in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable the timeout. Puppeteer's default timeout can be changed using [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md).

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: GeolocationOptions
---

# GeolocationOptions interface

### Signature

```typescript
export interface GeolocationOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="accuracy">accuracy</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Optional non-negative accuracy value.

</td><td>

</td></tr>
<tr><td>

<span id="latitude">latitude</span>

</td><td>

</td><td>

number

</td><td>

Longitude between `-180` and `180`.

</td><td>

</td></tr>
<tr><td>

<span id="longitude">longitude</span>

</td><td>

</td><td>

number

</td><td>

Latitude between `-90` and `90`.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: GoToOptions
---

# GoToOptions interface

### Signature

```typescript
export interface GoToOptions extends WaitForOptions
```

**Extends:** [WaitForOptions](./puppeteer.waitforoptions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="referer">referer</span>

</td><td>

`optional`

</td><td>

string

</td><td>

If provided, it will take preference over the referer header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md).

</td><td>

</td></tr>
<tr><td>

<span id="referrerpolicy">referrerPolicy</span>

</td><td>

`optional`

</td><td>

string

</td><td>

If provided, it will take preference over the referer-policy header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md).

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: HandleFor
---

# HandleFor type

### Signature

```typescript
export type HandleFor<T> = T extends Node ? ElementHandle<T> : JSHandle<T>;
```

**References:** [ElementHandle](./puppeteer.elementhandle.md), [JSHandle](./puppeteer.jshandle.md)

    ---
sidebar_label: HandleOr
---

# HandleOr type

### Signature

```typescript
export type HandleOr<T> = HandleFor<T> | JSHandle<T> | T;
```

**References:** [HandleFor](./puppeteer.handlefor.md), [JSHandle](./puppeteer.jshandle.md)

    ---
sidebar_label: Handler
---

# Handler type

### Signature

```typescript
export type Handler<T = unknown> = (event: T) => void;
```

    ---
sidebar_label: HTTPRequest.abort
---

# HTTPRequest.abort() method

Aborts a request.

### Signature

```typescript
class HTTPRequest {
  abort(errorCode?: ErrorCode, priority?: number): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

errorCode

</td><td>

[ErrorCode](./puppeteer.errorcode.md)

</td><td>

_(Optional)_ optional error code to provide.

</td></tr>
<tr><td>

priority

</td><td>

number

</td><td>

_(Optional)_ If provided, intercept is resolved using cooperative handling rules. Otherwise, intercept is resolved immediately.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

To use this, request interception should be enabled with [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md). If it is not enabled, this method will throw an exception immediately.

    ---
sidebar_label: HTTPRequest.abortErrorReason
---

# HTTPRequest.abortErrorReason() method

The most recent reason for aborting the request

### Signature

```typescript
class HTTPRequest {
  abortErrorReason(): Protocol.Network.ErrorReason | null;
}
```

**Returns:**

Protocol.Network.ErrorReason \| null

    ---
sidebar_label: HTTPRequest.continue
---

# HTTPRequest.continue() method

Continues request with optional request overrides.

### Signature

```typescript
class HTTPRequest {
  continue(
    overrides?: ContinueRequestOverrides,
    priority?: number,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

overrides

</td><td>

[ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md)

</td><td>

_(Optional)_ optional overrides to apply to the request.

</td></tr>
<tr><td>

priority

</td><td>

number

</td><td>

_(Optional)_ If provided, intercept is resolved using cooperative handling rules. Otherwise, intercept is resolved immediately.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

To use this, request interception should be enabled with [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md).

Exception is immediately thrown if the request interception is not enabled.

## Example

```ts
await page.setRequestInterception(true);
page.on('request', request => {
  // Override headers
  const headers = Object.assign({}, request.headers(), {
    foo: 'bar', // set "foo" header
    origin: undefined, // remove "origin" header
  });
  request.continue({headers});
});
```

    ---
sidebar_label: HTTPRequest.continueRequestOverrides
---

# HTTPRequest.continueRequestOverrides() method

The `ContinueRequestOverrides` that will be used if the interception is allowed to continue (ie, `abort()` and `respond()` aren't called).

### Signature

```typescript
class HTTPRequest {
  continueRequestOverrides(): ContinueRequestOverrides;
}
```

**Returns:**

[ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md)

    ---
sidebar_label: HTTPRequest.enqueueInterceptAction
---

# HTTPRequest.enqueueInterceptAction() method

Adds an async request handler to the processing queue. Deferred handlers are not guaranteed to execute in any particular order, but they are guaranteed to resolve before the request interception is finalized.

### Signature

```typescript
class HTTPRequest {
  enqueueInterceptAction(
    pendingHandler: () => void | PromiseLike<unknown>,
  ): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pendingHandler

</td><td>

() =&gt; void \| PromiseLike&lt;unknown&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

void

    ---
sidebar_label: HTTPRequest.failure
---

# HTTPRequest.failure() method

Access information about the request's failure.

### Signature

```typescript
class HTTPRequest {
  abstract failure(): {
    errorText: string;
  } | null;
}
```

**Returns:**

&#123; errorText: string; &#125; \| null

`null` unless the request failed. If the request fails this can return an object with `errorText` containing a human-readable error message, e.g. `net::ERR_FAILED`. It is not guaranteed that there will be failure text if the request fails.

## Remarks

## Example

Example of logging all failed requests:

```ts
page.on('requestfailed', request => {
  console.log(request.url() + ' ' + request.failure().errorText);
});
```

    ---
sidebar_label: HTTPRequest.fetchPostData
---

# HTTPRequest.fetchPostData() method

Fetches the POST data for the request from the browser.

### Signature

```typescript
class HTTPRequest {
  abstract fetchPostData(): Promise<string | undefined>;
}
```

**Returns:**

Promise&lt;string \| undefined&gt;

    ---
sidebar_label: HTTPRequest.finalizeInterceptions
---

# HTTPRequest.finalizeInterceptions() method

Awaits pending interception handlers and then decides how to fulfill the request interception.

### Signature

```typescript
class HTTPRequest {
  finalizeInterceptions(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: HTTPRequest.frame
---

# HTTPRequest.frame() method

The frame that initiated the request, or null if navigating to error pages.

### Signature

```typescript
class HTTPRequest {
  abstract frame(): Frame | null;
}
```

**Returns:**

[Frame](./puppeteer.frame.md) \| null

    ---
sidebar_label: HTTPRequest.hasPostData
---

# HTTPRequest.hasPostData() method

True when the request has POST data. Note that [HTTPRequest.postData()](./puppeteer.httprequest.postdata.md) might still be undefined when this flag is true when the data is too long or not readily available in the decoded form. In that case, use [HTTPRequest.fetchPostData()](./puppeteer.httprequest.fetchpostdata.md).

### Signature

```typescript
class HTTPRequest {
  abstract hasPostData(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: HTTPRequest.headers
---

# HTTPRequest.headers() method

An object with HTTP headers associated with the request. All header names are lower-case.

### Signature

```typescript
class HTTPRequest {
  abstract headers(): Record<string, string>;
}
```

**Returns:**

Record&lt;string, string&gt;

    ---
sidebar_label: HTTPRequest.initiator
---

# HTTPRequest.initiator() method

The initiator of the request.

### Signature

```typescript
class HTTPRequest {
  abstract initiator(): Protocol.Network.Initiator | undefined;
}
```

**Returns:**

Protocol.Network.Initiator \| undefined

    ---
sidebar_label: HTTPRequest.interceptResolutionState
---

# HTTPRequest.interceptResolutionState() method

An InterceptResolutionState object describing the current resolution action and priority.

InterceptResolutionState contains: action: InterceptResolutionAction priority?: number

InterceptResolutionAction is one of: `abort`, `respond`, `continue`, `disabled`, `none`, or `already-handled`.

### Signature

```typescript
class HTTPRequest {
  interceptResolutionState(): InterceptResolutionState;
}
```

**Returns:**

[InterceptResolutionState](./puppeteer.interceptresolutionstate.md)

    ---
sidebar_label: HTTPRequest.isInterceptResolutionHandled
---

# HTTPRequest.isInterceptResolutionHandled() method

Is `true` if the intercept resolution has already been handled, `false` otherwise.

### Signature

```typescript
class HTTPRequest {
  isInterceptResolutionHandled(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: HTTPRequest.isNavigationRequest
---

# HTTPRequest.isNavigationRequest() method

True if the request is the driver of the current frame's navigation.

### Signature

```typescript
class HTTPRequest {
  abstract isNavigationRequest(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: HTTPRequest
---

# HTTPRequest class

Represents an HTTP request sent by a page.

### Signature

```typescript
export declare abstract class HTTPRequest
```

## Remarks

Whenever the page sends a request, such as for a network resource, the following events are emitted by Puppeteer's `page`:

- `request`: emitted when the request is issued by the page.

- `requestfinished` - emitted when the response body is downloaded and the request is complete.

If request fails at some point, then instead of `requestfinished` event the `requestfailed` event is emitted.

All of these events provide an instance of `HTTPRequest` representing the request that occurred:

```
page.on('request', request => ...)
```

NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with `requestfinished` event.

If request gets a 'redirect' response, the request is successfully finished with the `requestfinished` event, and a new request is issued to a redirected url.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `HTTPRequest` class.

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="client">client</span>

</td><td>

`readonly`

</td><td>

[CDPSession](./puppeteer.cdpsession.md)

</td><td>

**_(Experimental)_** Warning! Using this client can break Puppeteer. Use with caution.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="abort">[abort(errorCode, priority)](./puppeteer.httprequest.abort.md)</span>

</td><td>

</td><td>

Aborts a request.

**Remarks:**

To use this, request interception should be enabled with [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md). If it is not enabled, this method will throw an exception immediately.

</td></tr>
<tr><td>

<span id="aborterrorreason">[abortErrorReason()](./puppeteer.httprequest.aborterrorreason.md)</span>

</td><td>

</td><td>

The most recent reason for aborting the request

</td></tr>
<tr><td>

<span id="continue">[continue(overrides, priority)](./puppeteer.httprequest.continue.md)</span>

</td><td>

</td><td>

Continues request with optional request overrides.

**Remarks:**

To use this, request interception should be enabled with [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md).

Exception is immediately thrown if the request interception is not enabled.

</td></tr>
<tr><td>

<span id="continuerequestoverrides">[continueRequestOverrides()](./puppeteer.httprequest.continuerequestoverrides.md)</span>

</td><td>

</td><td>

The `ContinueRequestOverrides` that will be used if the interception is allowed to continue (ie, `abort()` and `respond()` aren't called).

</td></tr>
<tr><td>

<span id="enqueueinterceptaction">[enqueueInterceptAction(pendingHandler)](./puppeteer.httprequest.enqueueinterceptaction.md)</span>

</td><td>

</td><td>

Adds an async request handler to the processing queue. Deferred handlers are not guaranteed to execute in any particular order, but they are guaranteed to resolve before the request interception is finalized.

</td></tr>
<tr><td>

<span id="failure">[failure()](./puppeteer.httprequest.failure.md)</span>

</td><td>

</td><td>

Access information about the request's failure.

**Remarks:**

</td></tr>
<tr><td>

<span id="fetchpostdata">[fetchPostData()](./puppeteer.httprequest.fetchpostdata.md)</span>

</td><td>

</td><td>

Fetches the POST data for the request from the browser.

</td></tr>
<tr><td>

<span id="finalizeinterceptions">[finalizeInterceptions()](./puppeteer.httprequest.finalizeinterceptions.md)</span>

</td><td>

</td><td>

Awaits pending interception handlers and then decides how to fulfill the request interception.

</td></tr>
<tr><td>

<span id="frame">[frame()](./puppeteer.httprequest.frame.md)</span>

</td><td>

</td><td>

The frame that initiated the request, or null if navigating to error pages.

</td></tr>
<tr><td>

<span id="haspostdata">[hasPostData()](./puppeteer.httprequest.haspostdata.md)</span>

</td><td>

</td><td>

True when the request has POST data. Note that [HTTPRequest.postData()](./puppeteer.httprequest.postdata.md) might still be undefined when this flag is true when the data is too long or not readily available in the decoded form. In that case, use [HTTPRequest.fetchPostData()](./puppeteer.httprequest.fetchpostdata.md).

</td></tr>
<tr><td>

<span id="headers">[headers()](./puppeteer.httprequest.headers.md)</span>

</td><td>

</td><td>

An object with HTTP headers associated with the request. All header names are lower-case.

</td></tr>
<tr><td>

<span id="initiator">[initiator()](./puppeteer.httprequest.initiator.md)</span>

</td><td>

</td><td>

The initiator of the request.

</td></tr>
<tr><td>

<span id="interceptresolutionstate">[interceptResolutionState()](./puppeteer.httprequest.interceptresolutionstate.md)</span>

</td><td>

</td><td>

An InterceptResolutionState object describing the current resolution action and priority.

InterceptResolutionState contains: action: InterceptResolutionAction priority?: number

InterceptResolutionAction is one of: `abort`, `respond`, `continue`, `disabled`, `none`, or `already-handled`.

</td></tr>
<tr><td>

<span id="isinterceptresolutionhandled">[isInterceptResolutionHandled()](./puppeteer.httprequest.isinterceptresolutionhandled.md)</span>

</td><td>

</td><td>

Is `true` if the intercept resolution has already been handled, `false` otherwise.

</td></tr>
<tr><td>

<span id="isnavigationrequest">[isNavigationRequest()](./puppeteer.httprequest.isnavigationrequest.md)</span>

</td><td>

</td><td>

True if the request is the driver of the current frame's navigation.

</td></tr>
<tr><td>

<span id="method">[method()](./puppeteer.httprequest.method.md)</span>

</td><td>

</td><td>

The method used (`GET`, `POST`, etc.)

</td></tr>
<tr><td>

<span id="postdata">[postData()](./puppeteer.httprequest.postdata.md)</span>

</td><td>

</td><td>

The request's post body, if any.

</td></tr>
<tr><td>

<span id="redirectchain">[redirectChain()](./puppeteer.httprequest.redirectchain.md)</span>

</td><td>

</td><td>

A `redirectChain` is a chain of requests initiated to fetch a resource.

**Remarks:**

`redirectChain` is shared between all the requests of the same chain.

For example, if the website `http://example.com` has a single redirect to `https://example.com`, then the chain will contain one request:

```ts
const response = await page.goto('http://example.com');
const chain = response.request().redirectChain();
console.log(chain.length); // 1
console.log(chain[0].url()); // 'http://example.com'
```

If the website `https://google.com` has no redirects, then the chain will be empty:

```ts
const response = await page.goto('https://google.com');
const chain = response.request().redirectChain();
console.log(chain.length); // 0
```

</td></tr>
<tr><td>

<span id="resourcetype">[resourceType()](./puppeteer.httprequest.resourcetype.md)</span>

</td><td>

</td><td>

Contains the request's resource type as it was perceived by the rendering engine.

</td></tr>
<tr><td>

<span id="respond">[respond(response, priority)](./puppeteer.httprequest.respond.md)</span>

</td><td>

</td><td>

Fulfills a request with the given response.

**Remarks:**

To use this, request interception should be enabled with [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md).

Exception is immediately thrown if the request interception is not enabled.

</td></tr>
<tr><td>

<span id="response">[response()](./puppeteer.httprequest.response.md)</span>

</td><td>

</td><td>

A matching `HTTPResponse` object, or null if the response has not been received yet.

</td></tr>
<tr><td>

<span id="responseforrequest">[responseForRequest()](./puppeteer.httprequest.responseforrequest.md)</span>

</td><td>

</td><td>

The `ResponseForRequest` that gets used if the interception is allowed to respond (ie, `abort()` is not called).

</td></tr>
<tr><td>

<span id="url">[url()](./puppeteer.httprequest.url.md)</span>

</td><td>

</td><td>

The URL of the request

</td></tr>
</tbody></table>

    ---
sidebar_label: HTTPRequest.method
---

# HTTPRequest.method() method

The method used (`GET`, `POST`, etc.)

### Signature

```typescript
class HTTPRequest {
  abstract method(): string;
}
```

**Returns:**

string

    ---
sidebar_label: HTTPRequest.postData
---

# HTTPRequest.postData() method

The request's post body, if any.

### Signature

```typescript
class HTTPRequest {
  abstract postData(): string | undefined;
}
```

**Returns:**

string \| undefined

    ---
sidebar_label: HTTPRequest.redirectChain
---

# HTTPRequest.redirectChain() method

A `redirectChain` is a chain of requests initiated to fetch a resource.

### Signature

```typescript
class HTTPRequest {
  abstract redirectChain(): HTTPRequest[];
}
```

**Returns:**

[HTTPRequest](./puppeteer.httprequest.md)\[\]

the chain of requests - if a server responds with at least a single redirect, this chain will contain all requests that were redirected.

## Remarks

`redirectChain` is shared between all the requests of the same chain.

For example, if the website `http://example.com` has a single redirect to `https://example.com`, then the chain will contain one request:

```ts
const response = await page.goto('http://example.com');
const chain = response.request().redirectChain();
console.log(chain.length); // 1
console.log(chain[0].url()); // 'http://example.com'
```

If the website `https://google.com` has no redirects, then the chain will be empty:

```ts
const response = await page.goto('https://google.com');
const chain = response.request().redirectChain();
console.log(chain.length); // 0
```

    ---
sidebar_label: HTTPRequest.resourceType
---

# HTTPRequest.resourceType() method

Contains the request's resource type as it was perceived by the rendering engine.

### Signature

```typescript
class HTTPRequest {
  abstract resourceType(): ResourceType;
}
```

**Returns:**

[ResourceType](./puppeteer.resourcetype.md)

    ---
sidebar_label: HTTPRequest.respond
---

# HTTPRequest.respond() method

Fulfills a request with the given response.

### Signature

```typescript
class HTTPRequest {
  respond(
    response: Partial<ResponseForRequest>,
    priority?: number,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

response

</td><td>

Partial&lt;[ResponseForRequest](./puppeteer.responseforrequest.md)&gt;

</td><td>

the response to fulfill the request with.

</td></tr>
<tr><td>

priority

</td><td>

number

</td><td>

_(Optional)_ If provided, intercept is resolved using cooperative handling rules. Otherwise, intercept is resolved immediately.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

To use this, request interception should be enabled with [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md).

Exception is immediately thrown if the request interception is not enabled.

## Example

An example of fulfilling all requests with 404 responses:

```ts
await page.setRequestInterception(true);
page.on('request', request => {
  request.respond({
    status: 404,
    contentType: 'text/plain',
    body: 'Not Found!',
  });
});
```

NOTE: Mocking responses for dataURL requests is not supported. Calling `request.respond` for a dataURL request is a noop.

    ---
sidebar_label: HTTPRequest.response
---

# HTTPRequest.response() method

A matching `HTTPResponse` object, or null if the response has not been received yet.

### Signature

```typescript
class HTTPRequest {
  abstract response(): HTTPResponse | null;
}
```

**Returns:**

[HTTPResponse](./puppeteer.httpresponse.md) \| null

    ---
sidebar_label: HTTPRequest.responseForRequest
---

# HTTPRequest.responseForRequest() method

The `ResponseForRequest` that gets used if the interception is allowed to respond (ie, `abort()` is not called).

### Signature

```typescript
class HTTPRequest {
  responseForRequest(): Partial<ResponseForRequest> | null;
}
```

**Returns:**

Partial&lt;[ResponseForRequest](./puppeteer.responseforrequest.md)&gt; \| null

    ---
sidebar_label: HTTPRequest.url
---

# HTTPRequest.url() method

The URL of the request

### Signature

```typescript
class HTTPRequest {
  abstract url(): string;
}
```

**Returns:**

string

    ---
sidebar_label: HTTPResponse.buffer
---

# HTTPResponse.buffer() method

Promise which resolves to a buffer with response body.

### Signature

```typescript
class HTTPResponse {
  buffer(): Promise<Buffer>;
}
```

**Returns:**

Promise&lt;Buffer&gt;

## Remarks

The buffer might be re-encoded by the browser based on HTTP-headers or other heuristics. If the browser failed to detect the correct encoding, the buffer might be encoded incorrectly. See https://github.com/puppeteer/puppeteer/issues/6478.

    ---
sidebar_label: HTTPResponse.content
---

# HTTPResponse.content() method

Promise which resolves to a buffer with response body.

### Signature

```typescript
class HTTPResponse {
  abstract content(): Promise<Uint8Array>;
}
```

**Returns:**

Promise&lt;Uint8Array&gt;

## Remarks

The buffer might be re-encoded by the browser based on HTTP-headers or other heuristics. If the browser failed to detect the correct encoding, the buffer might be encoded incorrectly. See https://github.com/puppeteer/puppeteer/issues/6478.

    ---
sidebar_label: HTTPResponse.frame
---

# HTTPResponse.frame() method

A [Frame](./puppeteer.frame.md) that initiated this response, or `null` if navigating to error pages.

### Signature

```typescript
class HTTPResponse {
  abstract frame(): Frame | null;
}
```

**Returns:**

[Frame](./puppeteer.frame.md) \| null

    ---
sidebar_label: HTTPResponse.fromCache
---

# HTTPResponse.fromCache() method

True if the response was served from either the browser's disk cache or memory cache.

### Signature

```typescript
class HTTPResponse {
  abstract fromCache(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: HTTPResponse.fromServiceWorker
---

# HTTPResponse.fromServiceWorker() method

True if the response was served by a service worker.

### Signature

```typescript
class HTTPResponse {
  abstract fromServiceWorker(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: HTTPResponse.headers
---

# HTTPResponse.headers() method

An object with HTTP headers associated with the response. All header names are lower-case.

### Signature

```typescript
class HTTPResponse {
  abstract headers(): Record<string, string>;
}
```

**Returns:**

Record&lt;string, string&gt;

    ---
sidebar_label: HTTPResponse.json
---

# HTTPResponse.json() method

Promise which resolves to a JSON representation of response body.

### Signature

```typescript
class HTTPResponse {
  json(): Promise<any>;
}
```

**Returns:**

Promise&lt;any&gt;

## Remarks

This method will throw if the response body is not parsable via `JSON.parse`.

    ---
sidebar_label: HTTPResponse
---

# HTTPResponse class

The HTTPResponse class represents responses which are received by the [Page](./puppeteer.page.md) class.

### Signature

```typescript
export declare abstract class HTTPResponse
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `HTTPResponse` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="buffer">[buffer()](./puppeteer.httpresponse.buffer.md)</span>

</td><td>

</td><td>

Promise which resolves to a buffer with response body.

**Remarks:**

The buffer might be re-encoded by the browser based on HTTP-headers or other heuristics. If the browser failed to detect the correct encoding, the buffer might be encoded incorrectly. See https://github.com/puppeteer/puppeteer/issues/6478.

</td></tr>
<tr><td>

<span id="content">[content()](./puppeteer.httpresponse.content.md)</span>

</td><td>

</td><td>

Promise which resolves to a buffer with response body.

**Remarks:**

The buffer might be re-encoded by the browser based on HTTP-headers or other heuristics. If the browser failed to detect the correct encoding, the buffer might be encoded incorrectly. See https://github.com/puppeteer/puppeteer/issues/6478.

</td></tr>
<tr><td>

<span id="frame">[frame()](./puppeteer.httpresponse.frame.md)</span>

</td><td>

</td><td>

A [Frame](./puppeteer.frame.md) that initiated this response, or `null` if navigating to error pages.

</td></tr>
<tr><td>

<span id="fromcache">[fromCache()](./puppeteer.httpresponse.fromcache.md)</span>

</td><td>

</td><td>

True if the response was served from either the browser's disk cache or memory cache.

</td></tr>
<tr><td>

<span id="fromserviceworker">[fromServiceWorker()](./puppeteer.httpresponse.fromserviceworker.md)</span>

</td><td>

</td><td>

True if the response was served by a service worker.

</td></tr>
<tr><td>

<span id="headers">[headers()](./puppeteer.httpresponse.headers.md)</span>

</td><td>

</td><td>

An object with HTTP headers associated with the response. All header names are lower-case.

</td></tr>
<tr><td>

<span id="json">[json()](./puppeteer.httpresponse.json.md)</span>

</td><td>

</td><td>

Promise which resolves to a JSON representation of response body.

**Remarks:**

This method will throw if the response body is not parsable via `JSON.parse`.

</td></tr>
<tr><td>

<span id="ok">[ok()](./puppeteer.httpresponse.ok.md)</span>

</td><td>

</td><td>

True if the response was successful (status in the range 200-299).

</td></tr>
<tr><td>

<span id="remoteaddress">[remoteAddress()](./puppeteer.httpresponse.remoteaddress.md)</span>

</td><td>

</td><td>

The IP address and port number used to connect to the remote server.

</td></tr>
<tr><td>

<span id="request">[request()](./puppeteer.httpresponse.request.md)</span>

</td><td>

</td><td>

A matching [HTTPRequest](./puppeteer.httprequest.md) object.

</td></tr>
<tr><td>

<span id="securitydetails">[securityDetails()](./puppeteer.httpresponse.securitydetails.md)</span>

</td><td>

</td><td>

[SecurityDetails](./puppeteer.securitydetails.md) if the response was received over the secure connection, or `null` otherwise.

</td></tr>
<tr><td>

<span id="status">[status()](./puppeteer.httpresponse.status.md)</span>

</td><td>

</td><td>

The status code of the response (e.g., 200 for a success).

</td></tr>
<tr><td>

<span id="statustext">[statusText()](./puppeteer.httpresponse.statustext.md)</span>

</td><td>

</td><td>

The status text of the response (e.g. usually an "OK" for a success).

</td></tr>
<tr><td>

<span id="text">[text()](./puppeteer.httpresponse.text.md)</span>

</td><td>

</td><td>

Promise which resolves to a text (utf8) representation of response body.

</td></tr>
<tr><td>

<span id="timing">[timing()](./puppeteer.httpresponse.timing.md)</span>

</td><td>

</td><td>

Timing information related to the response.

</td></tr>
<tr><td>

<span id="url">[url()](./puppeteer.httpresponse.url.md)</span>

</td><td>

</td><td>

The URL of the response.

</td></tr>
</tbody></table>

    ---
sidebar_label: HTTPResponse.ok
---

# HTTPResponse.ok() method

True if the response was successful (status in the range 200-299).

### Signature

```typescript
class HTTPResponse {
  ok(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: HTTPResponse.remoteAddress
---

# HTTPResponse.remoteAddress() method

The IP address and port number used to connect to the remote server.

### Signature

```typescript
class HTTPResponse {
  abstract remoteAddress(): RemoteAddress;
}
```

**Returns:**

[RemoteAddress](./puppeteer.remoteaddress.md)

    ---
sidebar_label: HTTPResponse.request
---

# HTTPResponse.request() method

A matching [HTTPRequest](./puppeteer.httprequest.md) object.

### Signature

```typescript
class HTTPResponse {
  abstract request(): HTTPRequest;
}
```

**Returns:**

[HTTPRequest](./puppeteer.httprequest.md)

    ---
sidebar_label: HTTPResponse.securityDetails
---

# HTTPResponse.securityDetails() method

[SecurityDetails](./puppeteer.securitydetails.md) if the response was received over the secure connection, or `null` otherwise.

### Signature

```typescript
class HTTPResponse {
  abstract securityDetails(): SecurityDetails | null;
}
```

**Returns:**

[SecurityDetails](./puppeteer.securitydetails.md) \| null

    ---
sidebar_label: HTTPResponse.status
---

# HTTPResponse.status() method

The status code of the response (e.g., 200 for a success).

### Signature

```typescript
class HTTPResponse {
  abstract status(): number;
}
```

**Returns:**

number

    ---
sidebar_label: HTTPResponse.statusText
---

# HTTPResponse.statusText() method

The status text of the response (e.g. usually an "OK" for a success).

### Signature

```typescript
class HTTPResponse {
  abstract statusText(): string;
}
```

**Returns:**

string

    ---
sidebar_label: HTTPResponse.text
---

# HTTPResponse.text() method

Promise which resolves to a text (utf8) representation of response body.

### Signature

```typescript
class HTTPResponse {
  text(): Promise<string>;
}
```

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: HTTPResponse.timing
---

# HTTPResponse.timing() method

Timing information related to the response.

### Signature

```typescript
class HTTPResponse {
  abstract timing(): Protocol.Network.ResourceTiming | null;
}
```

**Returns:**

Protocol.Network.ResourceTiming \| null

    ---
sidebar_label: HTTPResponse.url
---

# HTTPResponse.url() method

The URL of the response.

### Signature

```typescript
class HTTPResponse {
  abstract url(): string;
}
```

**Returns:**

string

    ---
sidebar_label: ImageFormat
---

# ImageFormat type

### Signature

```typescript
export type ImageFormat = 'png' | 'jpeg' | 'webp';
```

    ---
sidebar_label: InnerParams
---

# InnerParams type

### Signature

```typescript
export type InnerParams<T extends unknown[]> = {
  [K in keyof T]: FlattenHandle<T[K]>;
};
```

**References:** [FlattenHandle](./puppeteer.flattenhandle.md)

    ---
sidebar_label: InterceptResolutionAction
---

# InterceptResolutionAction enum

### Signature

```typescript
export declare enum InterceptResolutionAction
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

Abort

</td><td>

`"abort"`

</td><td>

</td></tr>
<tr><td>

AlreadyHandled

</td><td>

`"already-handled"`

</td><td>

</td></tr>
<tr><td>

Continue

</td><td>

`"continue"`

</td><td>

</td></tr>
<tr><td>

Disabled

</td><td>

`"disabled"`

</td><td>

</td></tr>
<tr><td>

None

</td><td>

`"none"`

</td><td>

</td></tr>
<tr><td>

Respond

</td><td>

`"respond"`

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: InterceptResolutionState
---

# InterceptResolutionState interface

### Signature

```typescript
export interface InterceptResolutionState
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="action">action</span>

</td><td>

</td><td>

[InterceptResolutionAction](./puppeteer.interceptresolutionaction.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="priority">priority</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: InternalNetworkConditions
---

# InternalNetworkConditions interface

### Signature

```typescript
export interface InternalNetworkConditions extends NetworkConditions
```

**Extends:** [NetworkConditions](./puppeteer.networkconditions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="offline">offline</span>

</td><td>

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: JSCoverage
---

# JSCoverage class

### Signature

```typescript
export declare class JSCoverage
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `JSCoverage` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="start">[start(options)](./puppeteer.jscoverage.start.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="stop">[stop()](./puppeteer.jscoverage.stop.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: JSCoverage.start
---

# JSCoverage.start() method

### Signature

```typescript
class JSCoverage {
  start(options?: {
    resetOnNavigation?: boolean;
    reportAnonymousScripts?: boolean;
    includeRawScriptCoverage?: boolean;
    useBlockCoverage?: boolean;
  }): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

&#123; resetOnNavigation?: boolean; reportAnonymousScripts?: boolean; includeRawScriptCoverage?: boolean; useBlockCoverage?: boolean; &#125;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: JSCoverage.stop
---

# JSCoverage.stop() method

### Signature

```typescript
class JSCoverage {
  stop(): Promise<JSCoverageEntry[]>;
}
```

**Returns:**

Promise&lt;[JSCoverageEntry](./puppeteer.jscoverageentry.md)\[\]&gt;

    ---
sidebar_label: JSCoverageEntry
---

# JSCoverageEntry interface

The CoverageEntry class for JavaScript

### Signature

```typescript
export interface JSCoverageEntry extends CoverageEntry
```

**Extends:** [CoverageEntry](./puppeteer.coverageentry.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="rawscriptcoverage">rawScriptCoverage</span>

</td><td>

`optional`

</td><td>

Protocol.Profiler.ScriptCoverage

</td><td>

Raw V8 script coverage entry.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: JSCoverageOptions
---

# JSCoverageOptions interface

Set of configurable options for JS coverage.

### Signature

```typescript
export interface JSCoverageOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="includerawscriptcoverage">includeRawScriptCoverage</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether the result includes raw V8 script coverage entries.

</td><td>

</td></tr>
<tr><td>

<span id="reportanonymousscripts">reportAnonymousScripts</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether anonymous scripts generated by the page should be reported.

</td><td>

</td></tr>
<tr><td>

<span id="resetonnavigation">resetOnNavigation</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to reset coverage on every navigation.

</td><td>

</td></tr>
<tr><td>

<span id="useblockcoverage">useBlockCoverage</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to collect coverage information at the block level. If true, coverage will be collected at the block level (this is the default). If false, coverage will be collected at the function level.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: JSHandle.asElement
---

# JSHandle.asElement() method

Either `null` or the handle itself if the handle is an instance of [ElementHandle](./puppeteer.elementhandle.md).

### Signature

```typescript
class JSHandle {
  abstract asElement(): ElementHandle<Node> | null;
}
```

**Returns:**

[ElementHandle](./puppeteer.elementhandle.md)&lt;Node&gt; \| null

    ---
sidebar_label: JSHandle.dispose
---

# JSHandle.dispose() method

Releases the object referenced by the handle for garbage collection.

### Signature

```typescript
class JSHandle {
  abstract dispose(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: JSHandle.evaluate
---

# JSHandle.evaluate() method

Evaluates the given function with the current handle as its first argument.

### Signature

```typescript
class JSHandle {
  evaluate<
    Params extends unknown[],
    Func extends EvaluateFuncWith<T, Params> = EvaluateFuncWith<T, Params>,
  >(
    pageFunction: Func | string,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

    ---
sidebar_label: JSHandle.evaluateHandle
---

# JSHandle.evaluateHandle() method

Evaluates the given function with the current handle as its first argument.

### Signature

```typescript
class JSHandle {
  evaluateHandle<
    Params extends unknown[],
    Func extends EvaluateFuncWith<T, Params> = EvaluateFuncWith<T, Params>,
  >(
    pageFunction: Func | string,
    ...args: Params
  ): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;&gt;

    ---
sidebar_label: JSHandle.getProperties
---

# JSHandle.getProperties() method

Gets a map of handles representing the properties of the current handle.

### Signature

```typescript
class JSHandle {
  getProperties(): Promise<Map<string, JSHandle>>;
}
```

**Returns:**

Promise&lt;Map&lt;string, [JSHandle](./puppeteer.jshandle.md)&gt;&gt;

## Example

```ts
const listHandle = await page.evaluateHandle(() => document.body.children);
const properties = await listHandle.getProperties();
const children = [];
for (const property of properties.values()) {
  const element = property.asElement();
  if (element) {
    children.push(element);
  }
}
children; // holds elementHandles to all children of document.body
```

    ---
sidebar_label: JSHandle.getProperty
---

# JSHandle.getProperty() method

<h2 id="getProperty">getProperty(): Promise&lt;HandleFor&lt;T\[K\]&gt;&gt;</h2>

Fetches a single property from the referenced object.

### Signature

```typescript
class JSHandle {
  getProperty<K extends keyof T>(
    propertyName: HandleOr<K>,
  ): Promise<HandleFor<T[K]>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

propertyName

</td><td>

[HandleOr](./puppeteer.handleor.md)&lt;K&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;T\[K\]&gt;&gt;

<h2 id="getProperty-1">getProperty(): Promise&lt;JSHandle&lt;unknown&gt;&gt;</h2>

### Signature

```typescript
class JSHandle {
  getProperty(propertyName: string): Promise<JSHandle<unknown>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

propertyName

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[JSHandle](./puppeteer.jshandle.md)&lt;unknown&gt;&gt;

    ---
sidebar_label: JSHandle.jsonValue
---

# JSHandle.jsonValue() method

A vanilla object representing the serializable portions of the referenced object.

### Signature

```typescript
class JSHandle {
  abstract jsonValue(): Promise<T>;
}
```

**Returns:**

Promise&lt;T&gt;

## Exceptions

Throws if the object cannot be serialized due to circularity.

## Remarks

If the object has a `toJSON` function, it **will not** be called.

    ---
sidebar_label: JSHandle
---

# JSHandle class

Represents a reference to a JavaScript object. Instances can be created using [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md).

Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely [disposed](./puppeteer.jshandle.dispose.md). JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed.

Handles can be used as arguments for any evaluation function such as [Page.$eval()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). They are resolved to their referenced object.

### Signature

```typescript
export declare abstract class JSHandle<T = unknown>
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `JSHandle` class.

## Example

```ts
const windowHandle = await page.evaluateHandle(() => window);
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_">\_</span>

</td><td>

`optional`

</td><td>

T

</td><td>

Used for nominally typing [JSHandle](./puppeteer.jshandle.md).

</td></tr>
<tr><td>

<span id="move">move</span>

</td><td>

</td><td>

() =&gt; this

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="aselement">[asElement()](./puppeteer.jshandle.aselement.md)</span>

</td><td>

</td><td>

Either `null` or the handle itself if the handle is an instance of [ElementHandle](./puppeteer.elementhandle.md).

</td></tr>
<tr><td>

<span id="dispose">[dispose()](./puppeteer.jshandle.dispose.md)</span>

</td><td>

</td><td>

Releases the object referenced by the handle for garbage collection.

</td></tr>
<tr><td>

<span id="evaluate">[evaluate(pageFunction, args)](./puppeteer.jshandle.evaluate.md)</span>

</td><td>

</td><td>

Evaluates the given function with the current handle as its first argument.

</td></tr>
<tr><td>

<span id="evaluatehandle">[evaluateHandle(pageFunction, args)](./puppeteer.jshandle.evaluatehandle.md)</span>

</td><td>

</td><td>

Evaluates the given function with the current handle as its first argument.

</td></tr>
<tr><td>

<span id="getproperties">[getProperties()](./puppeteer.jshandle.getproperties.md)</span>

</td><td>

</td><td>

Gets a map of handles representing the properties of the current handle.

</td></tr>
<tr><td>

<span id="getproperty">[getProperty(propertyName)](./puppeteer.jshandle.getproperty.md)</span>

</td><td>

</td><td>

Fetches a single property from the referenced object.

</td></tr>
<tr><td>

<span id="getproperty">[getProperty(propertyName)](./puppeteer.jshandle.getproperty.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="jsonvalue">[jsonValue()](./puppeteer.jshandle.jsonvalue.md)</span>

</td><td>

</td><td>

A vanilla object representing the serializable portions of the referenced object.

**Remarks:**

If the object has a `toJSON` function, it **will not** be called.

</td></tr>
<tr><td>

<span id="remoteobject">[remoteObject()](./puppeteer.jshandle.remoteobject.md)</span>

</td><td>

</td><td>

Provides access to the [Protocol.Runtime.RemoteObject](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject) backing this handle.

</td></tr>
<tr><td>

<span id="tostring">[toString()](./puppeteer.jshandle.tostring.md)</span>

</td><td>

</td><td>

Returns a string representation of the JSHandle.

**Remarks:**

Useful during debugging.

</td></tr>
</tbody></table>

    ---
sidebar_label: JSHandle.remoteObject
---

# JSHandle.remoteObject() method

Provides access to the [Protocol.Runtime.RemoteObject](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject) backing this handle.

### Signature

```typescript
class JSHandle {
  abstract remoteObject(): Protocol.Runtime.RemoteObject;
}
```

**Returns:**

Protocol.Runtime.RemoteObject

    ---
sidebar_label: JSHandle.toString
---

# JSHandle.toString() method

Returns a string representation of the JSHandle.

### Signature

```typescript
class JSHandle {
  abstract toString(): string;
}
```

**Returns:**

string

## Remarks

Useful during debugging.

    ---
sidebar_label: Keyboard.down
---

# Keyboard.down() method

Dispatches a `keydown` event.

### Signature

```typescript
class Keyboard {
  abstract down(
    key: KeyInput,
    options?: Readonly<KeyDownOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

key

</td><td>

[KeyInput](./puppeteer.keyinput.md)

</td><td>

Name of key to press, such as `ArrowLeft`. See [KeyInput](./puppeteer.keyinput.md) for a list of all key names.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[KeyDownOptions](./puppeteer.keydownoptions.md)&gt;

</td><td>

_(Optional)_ An object of options. Accepts text which, if specified, generates an input event with this text. Accepts commands which, if specified, is the commands of keyboard shortcuts, see [Chromium Source Code](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h) for valid command names.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also generated. The `text` option can be specified to force an input event to be generated. If `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that modifier active. To release the modifier key, use [Keyboard.up()](./puppeteer.keyboard.up.md).

After the key is pressed once, subsequent calls to [Keyboard.down()](./puppeteer.keyboard.down.md) will have [repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key, use [Keyboard.up()](./puppeteer.keyboard.up.md).

Modifier keys DO influence [Keyboard.down()](./puppeteer.keyboard.down.md). Holding down `Shift` will type the text in upper case.

    ---
sidebar_label: Keyboard
---

# Keyboard class

Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page.

### Signature

```typescript
export declare abstract class Keyboard
```

## Remarks

For finer control, you can use [Keyboard.down()](./puppeteer.keyboard.down.md), [Keyboard.up()](./puppeteer.keyboard.up.md), and [Keyboard.sendCharacter()](./puppeteer.keyboard.sendcharacter.md) to manually fire events as if they were generated from a real keyboard.

On macOS, keyboard shortcuts like `⌘ A` -&gt; Select All do not work. See [\#1313](https://github.com/puppeteer/puppeteer/issues/1313).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Keyboard` class.

## Example 1

An example of holding down `Shift` in order to select and delete some text:

```ts
await page.keyboard.type('Hello World!');
await page.keyboard.press('ArrowLeft');

await page.keyboard.down('Shift');
for (let i = 0; i < ' World'.length; i++)
  await page.keyboard.press('ArrowLeft');
await page.keyboard.up('Shift');

await page.keyboard.press('Backspace');
// Result text will end up saying 'Hello!'
```

## Example 2

An example of pressing `A`

```ts
await page.keyboard.down('Shift');
await page.keyboard.press('KeyA');
await page.keyboard.up('Shift');
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="down">[down(key, options)](./puppeteer.keyboard.down.md)</span>

</td><td>

</td><td>

Dispatches a `keydown` event.

**Remarks:**

If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also generated. The `text` option can be specified to force an input event to be generated. If `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that modifier active. To release the modifier key, use [Keyboard.up()](./puppeteer.keyboard.up.md).

After the key is pressed once, subsequent calls to [Keyboard.down()](./puppeteer.keyboard.down.md) will have [repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key, use [Keyboard.up()](./puppeteer.keyboard.up.md).

Modifier keys DO influence [Keyboard.down()](./puppeteer.keyboard.down.md). Holding down `Shift` will type the text in upper case.

</td></tr>
<tr><td>

<span id="press">[press(key, options)](./puppeteer.keyboard.press.md)</span>

</td><td>

</td><td>

Shortcut for [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md).

**Remarks:**

If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also generated. The `text` option can be specified to force an input event to be generated.

Modifier keys DO effect [Keyboard.press()](./puppeteer.keyboard.press.md). Holding down `Shift` will type the text in upper case.

</td></tr>
<tr><td>

<span id="sendcharacter">[sendCharacter(char)](./puppeteer.keyboard.sendcharacter.md)</span>

</td><td>

</td><td>

Dispatches a `keypress` and `input` event. This does not send a `keydown` or `keyup` event.

**Remarks:**

Modifier keys DO NOT effect [Keyboard.sendCharacter](./puppeteer.keyboard.sendcharacter.md). Holding down `Shift` will not type the text in upper case.

</td></tr>
<tr><td>

<span id="type">[type(text, options)](./puppeteer.keyboard.type.md)</span>

</td><td>

</td><td>

Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

**Remarks:**

To press a special key, like `Control` or `ArrowDown`, use [Keyboard.press()](./puppeteer.keyboard.press.md).

Modifier keys DO NOT effect `keyboard.type`. Holding down `Shift` will not type the text in upper case.

</td></tr>
<tr><td>

<span id="up">[up(key)](./puppeteer.keyboard.up.md)</span>

</td><td>

</td><td>

Dispatches a `keyup` event.

</td></tr>
</tbody></table>

    ---
sidebar_label: Keyboard.press
---

# Keyboard.press() method

Shortcut for [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md).

### Signature

```typescript
class Keyboard {
  abstract press(
    key: KeyInput,
    options?: Readonly<KeyPressOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

key

</td><td>

[KeyInput](./puppeteer.keyinput.md)

</td><td>

Name of key to press, such as `ArrowLeft`. See [KeyInput](./puppeteer.keyinput.md) for a list of all key names.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[KeyPressOptions](./puppeteer.keypressoptions.md)&gt;

</td><td>

_(Optional)_ An object of options. Accepts text which, if specified, generates an input event with this text. Accepts delay which, if specified, is the time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0. Accepts commands which, if specified, is the commands of keyboard shortcuts, see [Chromium Source Code](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h) for valid command names.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also generated. The `text` option can be specified to force an input event to be generated.

Modifier keys DO effect [Keyboard.press()](./puppeteer.keyboard.press.md). Holding down `Shift` will type the text in upper case.

    ---
sidebar_label: Keyboard.sendCharacter
---

# Keyboard.sendCharacter() method

Dispatches a `keypress` and `input` event. This does not send a `keydown` or `keyup` event.

### Signature

```typescript
class Keyboard {
  abstract sendCharacter(char: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

char

</td><td>

string

</td><td>

Character to send into the page.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Modifier keys DO NOT effect [Keyboard.sendCharacter](./puppeteer.keyboard.sendcharacter.md). Holding down `Shift` will not type the text in upper case.

## Example

```ts
page.keyboard.sendCharacter('嗨');
```

    ---
sidebar_label: Keyboard.type
---

# Keyboard.type() method

Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

### Signature

```typescript
class Keyboard {
  abstract type(
    text: string,
    options?: Readonly<KeyboardTypeOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

text

</td><td>

string

</td><td>

A text to type into a focused element.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)&gt;

</td><td>

_(Optional)_ An object of options. Accepts delay which, if specified, is the time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

To press a special key, like `Control` or `ArrowDown`, use [Keyboard.press()](./puppeteer.keyboard.press.md).

Modifier keys DO NOT effect `keyboard.type`. Holding down `Shift` will not type the text in upper case.

## Example

```ts
await page.keyboard.type('Hello'); // Types instantly
await page.keyboard.type('World', {delay: 100}); // Types slower, like a user
```

    ---
sidebar_label: Keyboard.up
---

# Keyboard.up() method

Dispatches a `keyup` event.

### Signature

```typescript
class Keyboard {
  abstract up(key: KeyInput): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

key

</td><td>

[KeyInput](./puppeteer.keyinput.md)

</td><td>

Name of key to release, such as `ArrowLeft`. See [KeyInput](./puppeteer.keyinput.md) for a list of all key names.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: KeyboardTypeOptions
---

# KeyboardTypeOptions interface

### Signature

```typescript
export interface KeyboardTypeOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="delay">delay</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: KeyDownOptions
---

# KeyDownOptions interface

### Signature

```typescript
export interface KeyDownOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="commands">commands</span>

</td><td>

`optional, deprecated`

</td><td>

string\[\]

</td><td>

**Deprecated:**

Do not use. This is automatically handled.

</td><td>

</td></tr>
<tr><td>

<span id="text">text</span>

</td><td>

`optional, deprecated`

</td><td>

string

</td><td>

**Deprecated:**

Do not use. This is automatically handled.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: KeyInput
---

# KeyInput type

All the valid keys that can be passed to functions that take user input, such as [keyboard.press](./puppeteer.keyboard.press.md)

### Signature

```typescript
export type KeyInput =
  | '0'
  | '1'
  | '2'
  | '3'
  | '4'
  | '5'
  | '6'
  | '7'
  | '8'
  | '9'
  | 'Power'
  | 'Eject'
  | 'Abort'
  | 'Help'
  | 'Backspace'
  | 'Tab'
  | 'Numpad5'
  | 'NumpadEnter'
  | 'Enter'
  | '\r'
  | '\n'
  | 'ShiftLeft'
  | 'ShiftRight'
  | 'ControlLeft'
  | 'ControlRight'
  | 'AltLeft'
  | 'AltRight'
  | 'Pause'
  | 'CapsLock'
  | 'Escape'
  | 'Convert'
  | 'NonConvert'
  | 'Space'
  | 'Numpad9'
  | 'PageUp'
  | 'Numpad3'
  | 'PageDown'
  | 'End'
  | 'Numpad1'
  | 'Home'
  | 'Numpad7'
  | 'ArrowLeft'
  | 'Numpad4'
  | 'Numpad8'
  | 'ArrowUp'
  | 'ArrowRight'
  | 'Numpad6'
  | 'Numpad2'
  | 'ArrowDown'
  | 'Select'
  | 'Open'
  | 'PrintScreen'
  | 'Insert'
  | 'Numpad0'
  | 'Delete'
  | 'NumpadDecimal'
  | 'Digit0'
  | 'Digit1'
  | 'Digit2'
  | 'Digit3'
  | 'Digit4'
  | 'Digit5'
  | 'Digit6'
  | 'Digit7'
  | 'Digit8'
  | 'Digit9'
  | 'KeyA'
  | 'KeyB'
  | 'KeyC'
  | 'KeyD'
  | 'KeyE'
  | 'KeyF'
  | 'KeyG'
  | 'KeyH'
  | 'KeyI'
  | 'KeyJ'
  | 'KeyK'
  | 'KeyL'
  | 'KeyM'
  | 'KeyN'
  | 'KeyO'
  | 'KeyP'
  | 'KeyQ'
  | 'KeyR'
  | 'KeyS'
  | 'KeyT'
  | 'KeyU'
  | 'KeyV'
  | 'KeyW'
  | 'KeyX'
  | 'KeyY'
  | 'KeyZ'
  | 'MetaLeft'
  | 'MetaRight'
  | 'ContextMenu'
  | 'NumpadMultiply'
  | 'NumpadAdd'
  | 'NumpadSubtract'
  | 'NumpadDivide'
  | 'F1'
  | 'F2'
  | 'F3'
  | 'F4'
  | 'F5'
  | 'F6'
  | 'F7'
  | 'F8'
  | 'F9'
  | 'F10'
  | 'F11'
  | 'F12'
  | 'F13'
  | 'F14'
  | 'F15'
  | 'F16'
  | 'F17'
  | 'F18'
  | 'F19'
  | 'F20'
  | 'F21'
  | 'F22'
  | 'F23'
  | 'F24'
  | 'NumLock'
  | 'ScrollLock'
  | 'AudioVolumeMute'
  | 'AudioVolumeDown'
  | 'AudioVolumeUp'
  | 'MediaTrackNext'
  | 'MediaTrackPrevious'
  | 'MediaStop'
  | 'MediaPlayPause'
  | 'Semicolon'
  | 'Equal'
  | 'NumpadEqual'
  | 'Comma'
  | 'Minus'
  | 'Period'
  | 'Slash'
  | 'Backquote'
  | 'BracketLeft'
  | 'Backslash'
  | 'BracketRight'
  | 'Quote'
  | 'AltGraph'
  | 'Props'
  | 'Cancel'
  | 'Clear'
  | 'Shift'
  | 'Control'
  | 'Alt'
  | 'Accept'
  | 'ModeChange'
  | ' '
  | 'Print'
  | 'Execute'
  | '\u0000'
  | 'a'
  | 'b'
  | 'c'
  | 'd'
  | 'e'
  | 'f'
  | 'g'
  | 'h'
  | 'i'
  | 'j'
  | 'k'
  | 'l'
  | 'm'
  | 'n'
  | 'o'
  | 'p'
  | 'q'
  | 'r'
  | 's'
  | 't'
  | 'u'
  | 'v'
  | 'w'
  | 'x'
  | 'y'
  | 'z'
  | 'Meta'
  | '*'
  | '+'
  | '-'
  | '/'
  | ';'
  | '='
  | ','
  | '.'
  | '`'
  | '['
  | '\\'
  | ']'
  | "'"
  | 'Attn'
  | 'CrSel'
  | 'ExSel'
  | 'EraseEof'
  | 'Play'
  | 'ZoomOut'
  | ')'
  | '!'
  | '@'
  | '#'
  | '$'
  | '%'
  | '^'
  | '&'
  | '('
  | 'A'
  | 'B'
  | 'C'
  | 'D'
  | 'E'
  | 'F'
  | 'G'
  | 'H'
  | 'I'
  | 'J'
  | 'K'
  | 'L'
  | 'M'
  | 'N'
  | 'O'
  | 'P'
  | 'Q'
  | 'R'
  | 'S'
  | 'T'
  | 'U'
  | 'V'
  | 'W'
  | 'X'
  | 'Y'
  | 'Z'
  | ':'
  | '<'
  | '_'
  | '>'
  | '?'
  | '~'
  | '{'
  | '|'
  | '}'
  | '"'
  | 'SoftLeft'
  | 'SoftRight'
  | 'Camera'
  | 'Call'
  | 'EndCall'
  | 'VolumeDown'
  | 'VolumeUp';
```

    ---
sidebar_label: KeyPressOptions
---

# KeyPressOptions type

### Signature

```typescript
export type KeyPressOptions = KeyDownOptions & KeyboardTypeOptions;
```

**References:** [KeyDownOptions](./puppeteer.keydownoptions.md), [KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)

    ---
sidebar_label: KnownDevices
---

# KnownDevices variable

A list of devices to be used with [Page.emulate()](./puppeteer.page.emulate.md).

### Signature

```typescript
KnownDevices: Readonly<
  Record<
    | 'Blackberry PlayBook'
    | 'Blackberry PlayBook landscape'
    | 'BlackBerry Z30'
    | 'BlackBerry Z30 landscape'
    | 'Galaxy Note 3'
    | 'Galaxy Note 3 landscape'
    | 'Galaxy Note II'
    | 'Galaxy Note II landscape'
    | 'Galaxy S III'
    | 'Galaxy S III landscape'
    | 'Galaxy S5'
    | 'Galaxy S5 landscape'
    | 'Galaxy S8'
    | 'Galaxy S8 landscape'
    | 'Galaxy S9+'
    | 'Galaxy S9+ landscape'
    | 'Galaxy Tab S4'
    | 'Galaxy Tab S4 landscape'
    | 'iPad'
    | 'iPad landscape'
    | 'iPad (gen 6)'
    | 'iPad (gen 6) landscape'
    | 'iPad (gen 7)'
    | 'iPad (gen 7) landscape'
    | 'iPad Mini'
    | 'iPad Mini landscape'
    | 'iPad Pro'
    | 'iPad Pro landscape'
    | 'iPad Pro 11'
    | 'iPad Pro 11 landscape'
    | 'iPhone 4'
    | 'iPhone 4 landscape'
    | 'iPhone 5'
    | 'iPhone 5 landscape'
    | 'iPhone 6'
    | 'iPhone 6 landscape'
    | 'iPhone 6 Plus'
    | 'iPhone 6 Plus landscape'
    | 'iPhone 7'
    | 'iPhone 7 landscape'
    | 'iPhone 7 Plus'
    | 'iPhone 7 Plus landscape'
    | 'iPhone 8'
    | 'iPhone 8 landscape'
    | 'iPhone 8 Plus'
    | 'iPhone 8 Plus landscape'
    | 'iPhone SE'
    | 'iPhone SE landscape'
    | 'iPhone X'
    | 'iPhone X landscape'
    | 'iPhone XR'
    | 'iPhone XR landscape'
    | 'iPhone 11'
    | 'iPhone 11 landscape'
    | 'iPhone 11 Pro'
    | 'iPhone 11 Pro landscape'
    | 'iPhone 11 Pro Max'
    | 'iPhone 11 Pro Max landscape'
    | 'iPhone 12'
    | 'iPhone 12 landscape'
    | 'iPhone 12 Pro'
    | 'iPhone 12 Pro landscape'
    | 'iPhone 12 Pro Max'
    | 'iPhone 12 Pro Max landscape'
    | 'iPhone 12 Mini'
    | 'iPhone 12 Mini landscape'
    | 'iPhone 13'
    | 'iPhone 13 landscape'
    | 'iPhone 13 Pro'
    | 'iPhone 13 Pro landscape'
    | 'iPhone 13 Pro Max'
    | 'iPhone 13 Pro Max landscape'
    | 'iPhone 13 Mini'
    | 'iPhone 13 Mini landscape'
    | 'iPhone 14'
    | 'iPhone 14 landscape'
    | 'iPhone 14 Plus'
    | 'iPhone 14 Plus landscape'
    | 'iPhone 14 Pro'
    | 'iPhone 14 Pro landscape'
    | 'iPhone 14 Pro Max'
    | 'iPhone 14 Pro Max landscape'
    | 'iPhone 15'
    | 'iPhone 15 landscape'
    | 'iPhone 15 Plus'
    | 'iPhone 15 Plus landscape'
    | 'iPhone 15 Pro'
    | 'iPhone 15 Pro landscape'
    | 'iPhone 15 Pro Max'
    | 'iPhone 15 Pro Max landscape'
    | 'JioPhone 2'
    | 'JioPhone 2 landscape'
    | 'Kindle Fire HDX'
    | 'Kindle Fire HDX landscape'
    | 'LG Optimus L70'
    | 'LG Optimus L70 landscape'
    | 'Microsoft Lumia 550'
    | 'Microsoft Lumia 950'
    | 'Microsoft Lumia 950 landscape'
    | 'Nexus 10'
    | 'Nexus 10 landscape'
    | 'Nexus 4'
    | 'Nexus 4 landscape'
    | 'Nexus 5'
    | 'Nexus 5 landscape'
    | 'Nexus 5X'
    | 'Nexus 5X landscape'
    | 'Nexus 6'
    | 'Nexus 6 landscape'
    | 'Nexus 6P'
    | 'Nexus 6P landscape'
    | 'Nexus 7'
    | 'Nexus 7 landscape'
    | 'Nokia Lumia 520'
    | 'Nokia Lumia 520 landscape'
    | 'Nokia N9'
    | 'Nokia N9 landscape'
    | 'Pixel 2'
    | 'Pixel 2 landscape'
    | 'Pixel 2 XL'
    | 'Pixel 2 XL landscape'
    | 'Pixel 3'
    | 'Pixel 3 landscape'
    | 'Pixel 4'
    | 'Pixel 4 landscape'
    | 'Pixel 4a (5G)'
    | 'Pixel 4a (5G) landscape'
    | 'Pixel 5'
    | 'Pixel 5 landscape'
    | 'Moto G4'
    | 'Moto G4 landscape',
    Device
  >
>;
```

## Example

```ts
import {KnownDevices} from 'puppeteer';
const iPhone = KnownDevices['iPhone 15 Pro'];

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.emulate(iPhone);
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();
```

    ---
sidebar_label: launch
---

# launch() function

### Signature

```typescript
launch: (options?: PuppeteerCore.LaunchOptions) =>
  Promise<PuppeteerCore.Browser>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[PuppeteerCore.LaunchOptions](./puppeteer.launchoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[PuppeteerCore.Browser](./puppeteer.browser.md)&gt;

    ---
sidebar_label: LaunchOptions
---

# LaunchOptions interface

Generic launch options that can be passed when launching any browser.

### Signature

```typescript
export interface LaunchOptions extends ConnectOptions
```

**Extends:** [ConnectOptions](./puppeteer.connectoptions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="args">args</span>

</td><td>

`optional`

</td><td>

string\[\]

</td><td>

Additional command line arguments to pass to the browser instance.

</td><td>

</td></tr>
<tr><td>

<span id="browser">browser</span>

</td><td>

`optional`

</td><td>

[SupportedBrowser](./puppeteer.supportedbrowser.md)

</td><td>

Which browser to launch.

</td><td>

`chrome`

</td></tr>
<tr><td>

<span id="channel">channel</span>

</td><td>

`optional`

</td><td>

[ChromeReleaseChannel](./puppeteer.chromereleasechannel.md)

</td><td>

If specified for Chrome, looks for a regular Chrome installation at a known system location instead of using the bundled Chrome binary.

</td><td>

</td></tr>
<tr><td>

<span id="debuggingport">debuggingPort</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specify the debugging port number to use

</td><td>

</td></tr>
<tr><td>

<span id="devtools">devtools</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be forced to `false`.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="dumpio">dumpio</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

If true, pipes the browser process stdout and stderr to `process.stdout` and `process.stderr`.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="enableextensions">enableExtensions</span>

</td><td>

`optional`

</td><td>

boolean \| string\[\]

</td><td>

If `true`, avoids passing default arguments to the browser that would prevent extensions from being enabled. Passing a list of strings will load the provided paths as unpacked extensions.

</td><td>

</td></tr>
<tr><td>

<span id="env">env</span>

</td><td>

`optional`

</td><td>

Record&lt;string, string \| undefined&gt;

</td><td>

Specify environment variables that will be visible to the browser.

</td><td>

The contents of `process.env`.

</td></tr>
<tr><td>

<span id="executablepath">executablePath</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Path to a browser executable to use instead of the bundled browser. Note that Puppeteer is only guaranteed to work with the bundled browser, so use this setting at your own risk.

**Remarks:**

When using this is recommended to set the `browser` property as well as Puppeteer will default to `chrome` by default.

</td><td>

</td></tr>
<tr><td>

<span id="extraprefsfirefox">extraPrefsFirefox</span>

</td><td>

`optional`

</td><td>

Record&lt;string, unknown&gt;

</td><td>

[Additional preferences](https://searchfox.org/mozilla-release/source/modules/libpref/init/all.js) that can be passed when launching with Firefox.

</td><td>

</td></tr>
<tr><td>

<span id="handlesighup">handleSIGHUP</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Close the browser process on `SIGHUP`.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="handlesigint">handleSIGINT</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Close the browser process on `Ctrl+C`.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="handlesigterm">handleSIGTERM</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Close the browser process on `SIGTERM`.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="headless">headless</span>

</td><td>

`optional`

</td><td>

boolean \| 'shell'

</td><td>

Whether to run the browser in headless mode.

**Remarks:**

- `true` launches the browser in the [new headless](https://developer.chrome.com/articles/new-headless/) mode.

- `'shell'` launches [shell](https://developer.chrome.com/blog/chrome-headless-shell) known as the old headless mode.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="ignoredefaultargs">ignoreDefaultArgs</span>

</td><td>

`optional`

</td><td>

boolean \| string\[\]

</td><td>

If `true`, do not use `puppeteer.defaultArgs()` when creating a browser. If an array is provided, these args will be filtered out. Use this with care - you probably want the default arguments Puppeteer uses.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="pipe">pipe</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Connect to a browser over a pipe instead of a WebSocket. Only supported with Chrome.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Maximum time in milliseconds to wait for the browser to start. Pass `0` to disable the timeout.

</td><td>

`30_000` (30 seconds).

</td></tr>
<tr><td>

<span id="userdatadir">userDataDir</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Path to a user data directory. [see the Chromium docs](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/user_data_dir.md) for more info.

</td><td>

</td></tr>
<tr><td>

<span id="waitforinitialpage">waitForInitialPage</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to wait for the initial page to be ready. Useful when a user explicitly disables that (e.g. `--no-startup-window` for Chrome).

</td><td>

`true`

</td></tr>
</tbody></table>

    ---
sidebar_label: Locator.click
---

# Locator.click() method

Clicks the located element.

### Signature

```typescript
class Locator {
  click<ElementType extends Element>(
    this: Locator<ElementType>,
    options?: Readonly<LocatorClickOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[LocatorClickOptions](./puppeteer.locatorclickoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Locator.clone
---

# Locator.clone() method

Clones the locator.

### Signature

```typescript
class Locator {
  clone(): Locator<T>;
}
```

**Returns:**

[Locator](./puppeteer.locator.md)&lt;T&gt;

    ---
sidebar_label: Locator.fill
---

# Locator.fill() method

Fills out the input identified by the locator using the provided value. The type of the input is determined at runtime and the appropriate fill-out method is chosen based on the type. `contenteditable`, select, textarea and input elements are supported.

### Signature

```typescript
class Locator {
  fill<ElementType extends Element>(
    this: Locator<ElementType>,
    value: string,
    options?: Readonly<ActionOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

</td><td>

</td></tr>
<tr><td>

value

</td><td>

string

</td><td>

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[ActionOptions](./puppeteer.actionoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Locator.filter
---

# Locator.filter() method

Creates an expectation that is evaluated against located values.

If the expectations do not match, then the locator will retry.

### Signature

```typescript
class Locator {
  filter<S extends T>(predicate: Predicate<T, S>): Locator<S>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

predicate

</td><td>

[Predicate](./puppeteer.predicate.md)&lt;T, S&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;S&gt;

    ---
sidebar_label: Locator.hover
---

# Locator.hover() method

Hovers over the located element.

### Signature

```typescript
class Locator {
  hover<ElementType extends Element>(
    this: Locator<ElementType>,
    options?: Readonly<ActionOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[ActionOptions](./puppeteer.actionoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Locator.map
---

# Locator.map() method

Maps the locator using the provided mapper.

### Signature

```typescript
class Locator {
  map<To>(mapper: Mapper<T, To>): Locator<To>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

mapper

</td><td>

[Mapper](./puppeteer.mapper.md)&lt;T, To&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;To&gt;

    ---
sidebar_label: Locator
---

# Locator class

Locators describe a strategy of locating objects and performing an action on them. If the action fails because the object is not ready for the action, the whole operation is retried. Various preconditions for a successful action are checked automatically.

See [https://pptr.dev/guides/page-interactions\#locators](https://pptr.dev/guides/page-interactions#locators) for details.

### Signature

```typescript
export declare abstract class Locator<T> extends EventEmitter<LocatorEvents>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[LocatorEvents](./puppeteer.locatorevents.md)&gt;

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_">\_</span>

</td><td>

`optional`

</td><td>

T

</td><td>

Used for nominally typing [Locator](./puppeteer.locator.md).

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`readonly`

</td><td>

number

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="click">[click(this, options)](./puppeteer.locator.click.md)</span>

</td><td>

</td><td>

Clicks the located element.

</td></tr>
<tr><td>

<span id="clone">[clone()](./puppeteer.locator.clone.md)</span>

</td><td>

</td><td>

Clones the locator.

</td></tr>
<tr><td>

<span id="fill">[fill(this, value, options)](./puppeteer.locator.fill.md)</span>

</td><td>

</td><td>

Fills out the input identified by the locator using the provided value. The type of the input is determined at runtime and the appropriate fill-out method is chosen based on the type. `contenteditable`, select, textarea and input elements are supported.

</td></tr>
<tr><td>

<span id="filter">[filter(predicate)](./puppeteer.locator.filter.md)</span>

</td><td>

</td><td>

Creates an expectation that is evaluated against located values.

If the expectations do not match, then the locator will retry.

</td></tr>
<tr><td>

<span id="hover">[hover(this, options)](./puppeteer.locator.hover.md)</span>

</td><td>

</td><td>

Hovers over the located element.

</td></tr>
<tr><td>

<span id="map">[map(mapper)](./puppeteer.locator.map.md)</span>

</td><td>

</td><td>

Maps the locator using the provided mapper.

</td></tr>
<tr><td>

<span id="race">[race(locators)](./puppeteer.locator.race.md)</span>

</td><td>

`static`

</td><td>

Creates a race between multiple locators trying to locate elements in parallel but ensures that only a single element receives the action.

</td></tr>
<tr><td>

<span id="scroll">[scroll(this, options)](./puppeteer.locator.scroll.md)</span>

</td><td>

</td><td>

Scrolls the located element.

</td></tr>
<tr><td>

<span id="setensureelementisintheviewport">[setEnsureElementIsInTheViewport(this, value)](./puppeteer.locator.setensureelementisintheviewport.md)</span>

</td><td>

</td><td>

Creates a new locator instance by cloning the current locator and specifying whether the locator should scroll the element into viewport if it is not in the viewport already.

</td></tr>
<tr><td>

<span id="settimeout">[setTimeout(timeout)](./puppeteer.locator.settimeout.md)</span>

</td><td>

</td><td>

Creates a new locator instance by cloning the current locator and setting the total timeout for the locator actions.

Pass `0` to disable timeout.

</td></tr>
<tr><td>

<span id="setvisibility">[setVisibility(this, visibility)](./puppeteer.locator.setvisibility.md)</span>

</td><td>

</td><td>

Creates a new locator instance by cloning the current locator with the visibility property changed to the specified value.

</td></tr>
<tr><td>

<span id="setwaitforenabled">[setWaitForEnabled(this, value)](./puppeteer.locator.setwaitforenabled.md)</span>

</td><td>

</td><td>

Creates a new locator instance by cloning the current locator and specifying whether to wait for input elements to become enabled before the action. Applicable to `click` and `fill` actions.

</td></tr>
<tr><td>

<span id="setwaitforstableboundingbox">[setWaitForStableBoundingBox(this, value)](./puppeteer.locator.setwaitforstableboundingbox.md)</span>

</td><td>

</td><td>

Creates a new locator instance by cloning the current locator and specifying whether the locator has to wait for the element's bounding box to be same between two consecutive animation frames.

</td></tr>
<tr><td>

<span id="wait">[wait(options)](./puppeteer.locator.wait.md)</span>

</td><td>

</td><td>

Waits for the locator to get the serialized value from the page.

Note this requires the value to be JSON-serializable.

</td></tr>
<tr><td>

<span id="waithandle">[waitHandle(options)](./puppeteer.locator.waithandle.md)</span>

</td><td>

</td><td>

Waits for the locator to get a handle from the page.

</td></tr>
</tbody></table>

    ---
sidebar_label: Locator.race
---

# Locator.race() method

Creates a race between multiple locators trying to locate elements in parallel but ensures that only a single element receives the action.

### Signature

```typescript
class Locator {
  static race<Locators extends readonly unknown[] | []>(
    locators: Locators,
  ): Locator<AwaitedLocator<Locators[number]>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

locators

</td><td>

Locators

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;[AwaitedLocator](./puppeteer.awaitedlocator.md)&lt;Locators\[number\]&gt;&gt;

    ---
sidebar_label: Locator.scroll
---

# Locator.scroll() method

Scrolls the located element.

### Signature

```typescript
class Locator {
  scroll<ElementType extends Element>(
    this: Locator<ElementType>,
    options?: Readonly<LocatorScrollOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

</td><td>

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[LocatorScrollOptions](./puppeteer.locatorscrolloptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Locator.setEnsureElementIsInTheViewport
---

# Locator.setEnsureElementIsInTheViewport() method

Creates a new locator instance by cloning the current locator and specifying whether the locator should scroll the element into viewport if it is not in the viewport already.

### Signature

```typescript
class Locator {
  setEnsureElementIsInTheViewport<ElementType extends Element>(
    this: Locator<ElementType>,
    value: boolean,
  ): Locator<ElementType>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

</td><td>

</td></tr>
<tr><td>

value

</td><td>

boolean

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

#### Default value:

`true`

    ---
sidebar_label: Locator.setTimeout
---

# Locator.setTimeout() method

Creates a new locator instance by cloning the current locator and setting the total timeout for the locator actions.

Pass `0` to disable timeout.

### Signature

```typescript
class Locator {
  setTimeout(timeout: number): Locator<T>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

timeout

</td><td>

number

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;T&gt;

#### Default value:

`Page.getDefaultTimeout()`

    ---
sidebar_label: Locator.setVisibility
---

# Locator.setVisibility() method

Creates a new locator instance by cloning the current locator with the visibility property changed to the specified value.

### Signature

```typescript
class Locator {
  setVisibility<NodeType extends Node>(
    this: Locator<NodeType>,
    visibility: VisibilityOption,
  ): Locator<NodeType>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;NodeType&gt;

</td><td>

</td></tr>
<tr><td>

visibility

</td><td>

[VisibilityOption](./puppeteer.visibilityoption.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;NodeType&gt;

    ---
sidebar_label: Locator.setWaitForEnabled
---

# Locator.setWaitForEnabled() method

Creates a new locator instance by cloning the current locator and specifying whether to wait for input elements to become enabled before the action. Applicable to `click` and `fill` actions.

### Signature

```typescript
class Locator {
  setWaitForEnabled<NodeType extends Node>(
    this: Locator<NodeType>,
    value: boolean,
  ): Locator<NodeType>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;NodeType&gt;

</td><td>

</td></tr>
<tr><td>

value

</td><td>

boolean

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;NodeType&gt;

#### Default value:

`true`

    ---
sidebar_label: Locator.setWaitForStableBoundingBox
---

# Locator.setWaitForStableBoundingBox() method

Creates a new locator instance by cloning the current locator and specifying whether the locator has to wait for the element's bounding box to be same between two consecutive animation frames.

### Signature

```typescript
class Locator {
  setWaitForStableBoundingBox<ElementType extends Element>(
    this: Locator<ElementType>,
    value: boolean,
  ): Locator<ElementType>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

this

</td><td>

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

</td><td>

</td></tr>
<tr><td>

value

</td><td>

boolean

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;

#### Default value:

`true`

    ---
sidebar_label: Locator.wait
---

# Locator.wait() method

Waits for the locator to get the serialized value from the page.

Note this requires the value to be JSON-serializable.

### Signature

```typescript
class Locator {
  wait(options?: Readonly<ActionOptions>): Promise<T>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[ActionOptions](./puppeteer.actionoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;T&gt;

    ---
sidebar_label: Locator.waitHandle
---

# Locator.waitHandle() method

Waits for the locator to get a handle from the page.

### Signature

```typescript
class Locator {
  waitHandle(options?: Readonly<ActionOptions>): Promise<HandleFor<T>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[ActionOptions](./puppeteer.actionoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;T&gt;&gt;

    ---
sidebar_label: LocatorClickOptions
---

# LocatorClickOptions type

### Signature

```typescript
export type LocatorClickOptions = ClickOptions & ActionOptions;
```

**References:** [ClickOptions](./puppeteer.clickoptions.md), [ActionOptions](./puppeteer.actionoptions.md)

    ---
sidebar_label: LocatorEvent
---

# LocatorEvent enum

All the events that a locator instance may emit.

### Signature

```typescript
export declare enum LocatorEvent
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

Action

</td><td>

`"action"`

</td><td>

Emitted every time before the locator performs an action on the located element(s).

</td></tr>
</tbody></table>

    ---
sidebar_label: LocatorEvents
---

# LocatorEvents interface

### Signature

```typescript
export interface LocatorEvents extends Record<EventType, unknown>
```

**Extends:** Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="action">action</span>

</td><td>

</td><td>

undefined

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: LocatorScrollOptions
---

# LocatorScrollOptions interface

### Signature

```typescript
export interface LocatorScrollOptions extends ActionOptions
```

**Extends:** [ActionOptions](./puppeteer.actionoptions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="scrollleft">scrollLeft</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="scrolltop">scrollTop</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: LowerCasePaperFormat
---

# LowerCasePaperFormat type

### Signature

```typescript
export type LowerCasePaperFormat =
  | 'letter'
  | 'legal'
  | 'tabloid'
  | 'ledger'
  | 'a0'
  | 'a1'
  | 'a2'
  | 'a3'
  | 'a4'
  | 'a5'
  | 'a6';
```

    ---
sidebar_label: Mapper
---

# Mapper type

### Signature

```typescript
export type Mapper<From, To> = (value: From) => Awaitable<To>;
```

**References:** [Awaitable](./puppeteer.awaitable.md)

    ---
sidebar_label: MediaFeature
---

# MediaFeature interface

A media feature to emulate.

### Signature

```typescript
export interface MediaFeature
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="name">name</span>

</td><td>

</td><td>

string

</td><td>

A name of the feature, for example, 'prefers-reduced-motion'.

</td><td>

</td></tr>
<tr><td>

<span id="value">value</span>

</td><td>

</td><td>

string

</td><td>

A value for the feature, for example, 'reduce'.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Metrics
---

# Metrics interface

### Signature

```typescript
export interface Metrics
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="documents">Documents</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="frames">Frames</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="jseventlisteners">JSEventListeners</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="jsheaptotalsize">JSHeapTotalSize</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="jsheapusedsize">JSHeapUsedSize</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="layoutcount">LayoutCount</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="layoutduration">LayoutDuration</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="nodes">Nodes</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="recalcstylecount">RecalcStyleCount</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="recalcstyleduration">RecalcStyleDuration</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="scriptduration">ScriptDuration</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="taskduration">TaskDuration</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="timestamp">Timestamp</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Mouse.click
---

# Mouse.click() method

Shortcut for `mouse.move`, `mouse.down` and `mouse.up`.

### Signature

```typescript
class Mouse {
  abstract click(
    x: number,
    y: number,
    options?: Readonly<MouseClickOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

x

</td><td>

number

</td><td>

Horizontal position of the mouse.

</td></tr>
<tr><td>

y

</td><td>

number

</td><td>

Vertical position of the mouse.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[MouseClickOptions](./puppeteer.mouseclickoptions.md)&gt;

</td><td>

_(Optional)_ Options to configure behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.down
---

# Mouse.down() method

Presses the mouse.

### Signature

```typescript
class Mouse {
  abstract down(options?: Readonly<MouseOptions>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[MouseOptions](./puppeteer.mouseoptions.md)&gt;

</td><td>

_(Optional)_ Options to configure behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.drag
---

# Mouse.drag() method

Dispatches a `drag` event.

### Signature

```typescript
class Mouse {
  abstract drag(start: Point, target: Point): Promise<Protocol.Input.DragData>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

start

</td><td>

[Point](./puppeteer.point.md)

</td><td>

starting point for drag

</td></tr>
<tr><td>

target

</td><td>

[Point](./puppeteer.point.md)

</td><td>

point to drag to

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Protocol.Input.DragData&gt;

    ---
sidebar_label: Mouse.dragAndDrop
---

# Mouse.dragAndDrop() method

Performs a drag, dragenter, dragover, and drop in sequence.

### Signature

```typescript
class Mouse {
  abstract dragAndDrop(
    start: Point,
    target: Point,
    options?: {
      delay?: number;
    },
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

start

</td><td>

[Point](./puppeteer.point.md)

</td><td>

point to drag from

</td></tr>
<tr><td>

target

</td><td>

[Point](./puppeteer.point.md)

</td><td>

point to drop on

</td></tr>
<tr><td>

options

</td><td>

&#123; delay?: number; &#125;

</td><td>

_(Optional)_ An object of options. Accepts delay which, if specified, is the time to wait between `dragover` and `drop` in milliseconds. Defaults to 0.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.dragEnter
---

# Mouse.dragEnter() method

Dispatches a `dragenter` event.

### Signature

```typescript
class Mouse {
  abstract dragEnter(
    target: Point,
    data: Protocol.Input.DragData,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

target

</td><td>

[Point](./puppeteer.point.md)

</td><td>

point for emitting `dragenter` event

</td></tr>
<tr><td>

data

</td><td>

Protocol.Input.DragData

</td><td>

drag data containing items and operations mask

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.dragOver
---

# Mouse.dragOver() method

Dispatches a `dragover` event.

### Signature

```typescript
class Mouse {
  abstract dragOver(
    target: Point,
    data: Protocol.Input.DragData,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

target

</td><td>

[Point](./puppeteer.point.md)

</td><td>

point for emitting `dragover` event

</td></tr>
<tr><td>

data

</td><td>

Protocol.Input.DragData

</td><td>

drag data containing items and operations mask

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.drop
---

# Mouse.drop() method

Performs a dragenter, dragover, and drop in sequence.

### Signature

```typescript
class Mouse {
  abstract drop(target: Point, data: Protocol.Input.DragData): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

target

</td><td>

[Point](./puppeteer.point.md)

</td><td>

point to drop on

</td></tr>
<tr><td>

data

</td><td>

Protocol.Input.DragData

</td><td>

drag data containing items and operations mask

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse
---

# Mouse class

The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.

### Signature

```typescript
export declare abstract class Mouse
```

## Remarks

Every `page` object has its own Mouse, accessible with [Page.mouse](./puppeteer.page.md#mouse).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Mouse` class.

## Example 1

```ts
// Using ‘page.mouse’ to trace a 100x100 square.
await page.mouse.move(0, 0);
await page.mouse.down();
await page.mouse.move(0, 100);
await page.mouse.move(100, 100);
await page.mouse.move(100, 0);
await page.mouse.move(0, 0);
await page.mouse.up();
```

**Note**: The mouse events trigger synthetic `MouseEvent`s. This means that it does not fully replicate the functionality of what a normal user would be able to do with their mouse.

For example, dragging and selecting text is not possible using `page.mouse`. Instead, you can use the [\`DocumentOrShadowRoot.getSelection()\`](https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/getSelection) functionality implemented in the platform.

## Example 2

For example, if you want to select all content between nodes:

```ts
await page.evaluate(
  (from, to) => {
    const selection = from.getRootNode().getSelection();
    const range = document.createRange();
    range.setStartBefore(from);
    range.setEndAfter(to);
    selection.removeAllRanges();
    selection.addRange(range);
  },
  fromJSHandle,
  toJSHandle,
);
```

If you then would want to copy-paste your selection, you can use the clipboard api:

```ts
// The clipboard api does not allow you to copy, unless the tab is focused.
await page.bringToFront();
await page.evaluate(() => {
  // Copy the selected content to the clipboard
  document.execCommand('copy');
  // Obtain the content of the clipboard as a string
  return navigator.clipboard.readText();
});
```

**Note**: If you want access to the clipboard API, you have to give it permission to do so:

```ts
await browser
  .defaultBrowserContext()
  .overridePermissions('<your origin>', ['clipboard-read', 'clipboard-write']);
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="click">[click(x, y, options)](./puppeteer.mouse.click.md)</span>

</td><td>

</td><td>

Shortcut for `mouse.move`, `mouse.down` and `mouse.up`.

</td></tr>
<tr><td>

<span id="down">[down(options)](./puppeteer.mouse.down.md)</span>

</td><td>

</td><td>

Presses the mouse.

</td></tr>
<tr><td>

<span id="drag">[drag(start, target)](./puppeteer.mouse.drag.md)</span>

</td><td>

</td><td>

Dispatches a `drag` event.

</td></tr>
<tr><td>

<span id="draganddrop">[dragAndDrop(start, target, options)](./puppeteer.mouse.draganddrop.md)</span>

</td><td>

</td><td>

Performs a drag, dragenter, dragover, and drop in sequence.

</td></tr>
<tr><td>

<span id="dragenter">[dragEnter(target, data)](./puppeteer.mouse.dragenter.md)</span>

</td><td>

</td><td>

Dispatches a `dragenter` event.

</td></tr>
<tr><td>

<span id="dragover">[dragOver(target, data)](./puppeteer.mouse.dragover.md)</span>

</td><td>

</td><td>

Dispatches a `dragover` event.

</td></tr>
<tr><td>

<span id="drop">[drop(target, data)](./puppeteer.mouse.drop.md)</span>

</td><td>

</td><td>

Performs a dragenter, dragover, and drop in sequence.

</td></tr>
<tr><td>

<span id="move">[move(x, y, options)](./puppeteer.mouse.move.md)</span>

</td><td>

</td><td>

Moves the mouse to the given coordinate.

</td></tr>
<tr><td>

<span id="reset">[reset()](./puppeteer.mouse.reset.md)</span>

</td><td>

</td><td>

Resets the mouse to the default state: No buttons pressed; position at (0,0).

</td></tr>
<tr><td>

<span id="up">[up(options)](./puppeteer.mouse.up.md)</span>

</td><td>

</td><td>

Releases the mouse.

</td></tr>
<tr><td>

<span id="wheel">[wheel(options)](./puppeteer.mouse.wheel.md)</span>

</td><td>

</td><td>

Dispatches a `mousewheel` event.

</td></tr>
</tbody></table>

    ---
sidebar_label: Mouse.move
---

# Mouse.move() method

Moves the mouse to the given coordinate.

### Signature

```typescript
class Mouse {
  abstract move(
    x: number,
    y: number,
    options?: Readonly<MouseMoveOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

x

</td><td>

number

</td><td>

Horizontal position of the mouse.

</td></tr>
<tr><td>

y

</td><td>

number

</td><td>

Vertical position of the mouse.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[MouseMoveOptions](./puppeteer.mousemoveoptions.md)&gt;

</td><td>

_(Optional)_ Options to configure behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.reset
---

# Mouse.reset() method

Resets the mouse to the default state: No buttons pressed; position at (0,0).

### Signature

```typescript
class Mouse {
  abstract reset(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.up
---

# Mouse.up() method

Releases the mouse.

### Signature

```typescript
class Mouse {
  abstract up(options?: Readonly<MouseOptions>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[MouseOptions](./puppeteer.mouseoptions.md)&gt;

</td><td>

_(Optional)_ Options to configure behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Mouse.wheel
---

# Mouse.wheel() method

Dispatches a `mousewheel` event.

### Signature

```typescript
class Mouse {
  abstract wheel(options?: Readonly<MouseWheelOptions>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[MouseWheelOptions](./puppeteer.mousewheeloptions.md)&gt;

</td><td>

_(Optional)_ Optional: `MouseWheelOptions`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

An example of zooming into an element:

```ts
await page.goto(
  'https://mdn.mozillademos.org/en-US/docs/Web/API/Element/wheel_event$samples/Scaling_an_element_via_the_wheel?revision=1587366',
);

const elem = await page.$('div');
const boundingBox = await elem.boundingBox();
await page.mouse.move(
  boundingBox.x + boundingBox.width / 2,
  boundingBox.y + boundingBox.height / 2,
);

await page.mouse.wheel({deltaY: -100});
```

    ---
sidebar_label: MouseButton
---

# MouseButton variable

Enum of valid mouse buttons.

### Signature

```typescript
MouseButton: Readonly<{
  Left: 'left';
  Right: 'right';
  Middle: 'middle';
  Back: 'back';
  Forward: 'forward';
}>;
```

    ---
sidebar_label: MouseClickOptions
---

# MouseClickOptions interface

### Signature

```typescript
export interface MouseClickOptions extends MouseOptions
```

**Extends:** [MouseOptions](./puppeteer.mouseoptions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="count">count</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Number of clicks to perform.

</td><td>

`1`

</td></tr>
<tr><td>

<span id="delay">delay</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Time (in ms) to delay the mouse release after the mouse press.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: MouseMoveOptions
---

# MouseMoveOptions interface

### Signature

```typescript
export interface MouseMoveOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="steps">steps</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Determines the number of movements to make from the current mouse position to the new one.

</td><td>

`1`

</td></tr>
</tbody></table>

    ---
sidebar_label: MouseOptions
---

# MouseOptions interface

### Signature

```typescript
export interface MouseOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="button">button</span>

</td><td>

`optional`

</td><td>

[MouseButton](./puppeteer.mousebutton.md)

</td><td>

Determines which button will be pressed.

</td><td>

`'left'`

</td></tr>
<tr><td>

<span id="clickcount">clickCount</span>

</td><td>

`optional, deprecated`

</td><td>

number

</td><td>

Determines the click count for the mouse event. This does not perform multiple clicks.

**Deprecated:**

Use [MouseClickOptions.count](./puppeteer.mouseclickoptions.md#count).

</td><td>

`1`

</td></tr>
</tbody></table>

    ---
sidebar_label: MouseWheelOptions
---

# MouseWheelOptions interface

### Signature

```typescript
export interface MouseWheelOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="deltax">deltaX</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="deltay">deltaY</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Moveable
---

# Moveable interface

### Signature

```typescript
export interface Moveable
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="move">[move()](./puppeteer.moveable.move.md)</span>

</td><td>

Moves the resource when 'using'.

</td></tr>
</tbody></table>

    ---
sidebar_label: Moveable.move
---

# Moveable.move() method

Moves the resource when 'using'.

### Signature

```typescript
interface Moveable {
  move(): this;
}
```

**Returns:**

this

    ---
sidebar_label: NetworkConditions
---

# NetworkConditions interface

### Signature

```typescript
export interface NetworkConditions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="download">download</span>

</td><td>

</td><td>

number

</td><td>

Download speed (bytes/s)

</td><td>

</td></tr>
<tr><td>

<span id="latency">latency</span>

</td><td>

</td><td>

number

</td><td>

Latency (ms)

</td><td>

</td></tr>
<tr><td>

<span id="upload">upload</span>

</td><td>

</td><td>

number

</td><td>

Upload speed (bytes/s)

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: NewDocumentScriptEvaluation
---

# NewDocumentScriptEvaluation interface

### Signature

```typescript
export interface NewDocumentScriptEvaluation
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="identifier">identifier</span>

</td><td>

</td><td>

string

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: NodeFor
---

# NodeFor type

### Signature

```typescript
export type NodeFor<ComplexSelector extends string> =
  ParseSelector<ComplexSelector>;
```

    ---
sidebar_label: Offset
---

# Offset interface

### Signature

```typescript
export interface Offset
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="x">x</span>

</td><td>

</td><td>

number

</td><td>

x-offset for the clickable point relative to the top-left corner of the border box.

</td><td>

</td></tr>
<tr><td>

<span id="y">y</span>

</td><td>

</td><td>

number

</td><td>

y-offset for the clickable point relative to the top-left corner of the border box.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Page.$
---

# Page.$() method

Finds the first element that matches the selector. If no element matches the selector, the return value resolves to `null`.

### Signature

```typescript
class Page {
  $<Selector extends string>(
    selector: Selector,
  ): Promise<ElementHandle<NodeFor<Selector>> | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt; \| null&gt;

## Remarks

Shortcut for [Page.mainFrame().$(selector)](./puppeteer.frame._.md).

    ---
sidebar_label: Page.$$
---

# Page.$$() method

Finds elements on the page that match the selector. If no elements match the selector, the return value resolves to `[]`.

### Signature

```typescript
class Page {
  $$<Selector extends string>(
    selector: Selector,
    options?: QueryOptions,
  ): Promise<Array<ElementHandle<NodeFor<Selector>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

options

</td><td>

[QueryOptions](./puppeteer.queryoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Array&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt;&gt;&gt;

## Remarks

Shortcut for [Page.mainFrame().$$(selector)](./puppeteer.frame.__.md).

    ---
sidebar_label: Page.$$eval
---

# Page.$$eval() method

This method returns all elements matching the selector and passes the resulting array as the first argument to the `pageFunction`.

### Signature

```typescript
class Page {
  $$eval<
    Selector extends string,
    Params extends unknown[],
    Func extends EvaluateFuncWith<
      Array<NodeFor<Selector>>,
      Params
    > = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
  >(
    selector: Selector,
    pageFunction: Func | string,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

the function to be evaluated in the page context. Will be passed an array of matching elements as its first argument.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

any additional arguments to pass through to `pageFunction`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

The result of calling `pageFunction`. If it returns an element it is wrapped in an [ElementHandle](./puppeteer.elementhandle.md), else the raw value itself is returned.

## Remarks

If `pageFunction` returns a promise `$$eval` will wait for the promise to resolve and then return its value.

## Example 1

```ts
// get the amount of divs on the page
const divCount = await page.$$eval('div', divs => divs.length);

// get the text content of all the `.options` elements:
const options = await page.$$eval('div > span.options', options => {
  return options.map(option => option.textContent);
});
```

If you are using TypeScript, you may have to provide an explicit type to the first argument of the `pageFunction`. By default it is typed as `Element[]`, but you may need to provide a more specific sub-type:

## Example 2

```ts
await page.$$eval('input', elements => {
  return elements.map(e => e.value);
});
```

The compiler should be able to infer the return type from the `pageFunction` you provide. If it is unable to, you can use the generic type to tell the compiler what return type you expect from `$$eval`:

## Example 3

```ts
const allInputValues = await page.$$eval('input', elements =>
  elements.map(e => e.textContent),
);
```

    ---
sidebar_label: Page.$eval
---

# Page.$eval() method

This method finds the first element within the page that matches the selector and passes the result as the first argument to the `pageFunction`.

### Signature

```typescript
class Page {
  $eval<
    Selector extends string,
    Params extends unknown[],
    Func extends EvaluateFuncWith<NodeFor<Selector>, Params> = EvaluateFuncWith<
      NodeFor<Selector>,
      Params
    >,
  >(
    selector: Selector,
    pageFunction: Func | string,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

the function to be evaluated in the page context. Will be passed the result of the element matching the selector as its first argument.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

any additional arguments to pass through to `pageFunction`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

The result of calling `pageFunction`. If it returns an element it is wrapped in an [ElementHandle](./puppeteer.elementhandle.md), else the raw value itself is returned.

## Remarks

If no element is found matching `selector`, the method will throw an error.

If `pageFunction` returns a promise `$eval` will wait for the promise to resolve and then return its value.

## Example 1

```ts
const searchValue = await page.$eval('#search', el => el.value);
const preloadHref = await page.$eval('link[rel=preload]', el => el.href);
const html = await page.$eval('.main-container', el => el.outerHTML);
```

If you are using TypeScript, you may have to provide an explicit type to the first argument of the `pageFunction`. By default it is typed as `Element`, but you may need to provide a more specific sub-type:

## Example 2

```ts
// if you don't provide HTMLInputElement here, TS will error
// as `value` is not on `Element`
const searchValue = await page.$eval(
  '#search',
  (el: HTMLInputElement) => el.value,
);
```

The compiler should be able to infer the return type from the `pageFunction` you provide. If it is unable to, you can use the generic type to tell the compiler what return type you expect from `$eval`:

## Example 3

```ts
// The compiler can infer the return type in this case, but if it can't
// or if you want to be more explicit, provide it as the generic type.
const searchValue = await page.$eval<string>(
  '#search',
  (el: HTMLInputElement) => el.value,
);
```

    ---
sidebar_label: Page.addScriptTag
---

# Page.addScriptTag() method

Adds a `<script>` tag into the page with the desired URL or content.

### Signature

```typescript
class Page {
  addScriptTag(
    options: FrameAddScriptTagOptions,
  ): Promise<ElementHandle<HTMLScriptElement>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md)

</td><td>

Options for the script.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLScriptElement&gt;&gt;

An [element handle](./puppeteer.elementhandle.md) to the injected `<script>` element.

## Remarks

Shortcut for [page.mainFrame().addScriptTag(options)](./puppeteer.frame.addscripttag.md).

    ---
sidebar_label: Page.addStyleTag
---

# Page.addStyleTag() method

<h2 id="addStyleTag">addStyleTag(): Promise&lt;ElementHandle&lt;HTMLStyleElement&gt;&gt;</h2>

Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a `<style type="text/css">` tag with the content.

Shortcut for [page.mainFrame().addStyleTag(options)](./puppeteer.frame.addstyletag.md).

### Signature

```typescript
class Page {
  addStyleTag(
    options: Omit<FrameAddStyleTagOptions, 'url'>,
  ): Promise<ElementHandle<HTMLStyleElement>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Omit&lt;[FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md), 'url'&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLStyleElement&gt;&gt;

An [element handle](./puppeteer.elementhandle.md) to the injected `<link>` or `<style>` element.

<h2 id="addStyleTag-1">addStyleTag(): Promise&lt;ElementHandle&lt;HTMLLinkElement&gt;&gt;</h2>

### Signature

```typescript
class Page {
  addStyleTag(
    options: FrameAddStyleTagOptions,
  ): Promise<ElementHandle<HTMLLinkElement>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;HTMLLinkElement&gt;&gt;

    ---
sidebar_label: Page.authenticate
---

# Page.authenticate() method

Provide credentials for `HTTP authentication`.

:::note

Request interception will be turned on behind the scenes to implement authentication. This might affect performance.

:::

### Signature

```typescript
class Page {
  abstract authenticate(credentials: Credentials | null): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

credentials

</td><td>

[Credentials](./puppeteer.credentials.md) \| null

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

To disable authentication, pass `null`.

    ---
sidebar_label: Page.bringToFront
---

# Page.bringToFront() method

Brings page to front (activates tab).

### Signature

```typescript
class Page {
  abstract bringToFront(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.browser
---

# Page.browser() method

Get the browser the page belongs to.

### Signature

```typescript
class Page {
  abstract browser(): Browser;
}
```

**Returns:**

[Browser](./puppeteer.browser.md)

    ---
sidebar_label: Page.browserContext
---

# Page.browserContext() method

Get the browser context that the page belongs to.

### Signature

```typescript
class Page {
  abstract browserContext(): BrowserContext;
}
```

**Returns:**

[BrowserContext](./puppeteer.browsercontext.md)

    ---
sidebar_label: Page.click
---

# Page.click() method

This method fetches an element with `selector`, scrolls it into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to click in the center of the element. If there's no element matching `selector`, the method throws an error.

### Signature

```typescript
class Page {
  click(selector: string, options?: Readonly<ClickOptions>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax). If there are multiple elements satisfying the `selector`, the first will be clicked

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[ClickOptions](./puppeteer.clickoptions.md)&gt;

</td><td>

_(Optional)_ `Object`

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

Promise which resolves when the element matching `selector` is successfully clicked. The Promise will be rejected if there is no element matching `selector`.

## Remarks

Bear in mind that if `click()` triggers a navigation event and there's a separate `page.waitForNavigation()` promise to be resolved, you may end up with a race condition that yields unexpected results. The correct pattern for click and wait for navigation is the following:

```ts
const [response] = await Promise.all([
  page.waitForNavigation(waitOptions),
  page.click(selector, clickOptions),
]);
```

Shortcut for [page.mainFrame().click(selector\[, options\])](./puppeteer.frame.click.md).

    ---
sidebar_label: Page.close
---

# Page.close() method

### Signature

```typescript
class Page {
  abstract close(options?: {runBeforeUnload?: boolean}): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

&#123; runBeforeUnload?: boolean; &#125;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.content
---

# Page.content() method

The full HTML contents of the page, including the DOCTYPE.

### Signature

```typescript
class Page {
  content(): Promise<string>;
}
```

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: Page.cookies
---

# Page.cookies() method

> Warning: This API is now obsolete.
>
> Page-level cookie API is deprecated. Use [Browser.cookies()](./puppeteer.browser.cookies.md) or [BrowserContext.cookies()](./puppeteer.browsercontext.cookies.md) instead.

If no URLs are specified, this method returns cookies for the current page URL. If URLs are specified, only cookies for those URLs are returned.

### Signature

```typescript
class Page {
  abstract cookies(...urls: string[]): Promise<Cookie[]>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

urls

</td><td>

string\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Cookie](./puppeteer.cookie.md)\[\]&gt;

    ---
sidebar_label: Page.createCDPSession
---

# Page.createCDPSession() method

Creates a Chrome Devtools Protocol session attached to the page.

### Signature

```typescript
class Page {
  abstract createCDPSession(): Promise<CDPSession>;
}
```

**Returns:**

Promise&lt;[CDPSession](./puppeteer.cdpsession.md)&gt;

    ---
sidebar_label: Page.createPDFStream
---

# Page.createPDFStream() method

Generates a PDF of the page with the `print` CSS media type.

### Signature

```typescript
class Page {
  abstract createPDFStream(
    options?: PDFOptions,
  ): Promise<ReadableStream<Uint8Array>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[PDFOptions](./puppeteer.pdfoptions.md)

</td><td>

_(Optional)_ options for generating the PDF.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;ReadableStream&lt;Uint8Array&gt;&gt;

## Remarks

To generate a PDF with the `screen` media type, call [\`page.emulateMediaType('screen')\`](./puppeteer.page.emulatemediatype.md) before calling `page.pdf()`.

By default, `page.pdf()` generates a pdf with modified colors for printing. Use the [\`-webkit-print-color-adjust\`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to force rendering of exact colors.

    ---
sidebar_label: Page.deleteCookie
---

# Page.deleteCookie() method

> Warning: This API is now obsolete.
>
> Page-level cookie API is deprecated. Use [Browser.deleteCookie()](./puppeteer.browser.deletecookie.md) or [BrowserContext.deleteCookie()](./puppeteer.browsercontext.deletecookie.md) instead.

### Signature

```typescript
class Page {
  abstract deleteCookie(...cookies: DeleteCookiesRequest[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

cookies

</td><td>

[DeleteCookiesRequest](./puppeteer.deletecookiesrequest.md)\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.emulate
---

# Page.emulate() method

Emulates a given device's metrics and user agent.

To aid emulation, Puppeteer provides a list of known devices that can be via [KnownDevices](./puppeteer.knowndevices.md).

### Signature

```typescript
class Page {
  emulate(device: Device): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

device

</td><td>

[Device](./puppeteer.device.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

This method is a shortcut for calling two methods: [Page.setUserAgent()](./puppeteer.page.setuseragent.md) and [Page.setViewport()](./puppeteer.page.setviewport.md).

This method will resize the page. A lot of websites don't expect phones to change size, so you should emulate before navigating to the page.

## Example

```ts
import {KnownDevices} from 'puppeteer';
const iPhone = KnownDevices['iPhone 15 Pro'];

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.emulate(iPhone);
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();
```

    ---
sidebar_label: Page.emulateCPUThrottling
---

# Page.emulateCPUThrottling() method

Enables CPU throttling to emulate slow CPUs.

### Signature

```typescript
class Page {
  abstract emulateCPUThrottling(factor: number | null): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

factor

</td><td>

number \| null

</td><td>

slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.emulateIdleState
---

# Page.emulateIdleState() method

Emulates the idle state. If no arguments set, clears idle state emulation.

### Signature

```typescript
class Page {
  abstract emulateIdleState(overrides?: {
    isUserActive: boolean;
    isScreenUnlocked: boolean;
  }): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

overrides

</td><td>

&#123; isUserActive: boolean; isScreenUnlocked: boolean; &#125;

</td><td>

_(Optional)_ Mock idle state. If not set, clears idle overrides

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

```ts
// set idle emulation
await page.emulateIdleState({isUserActive: true, isScreenUnlocked: false});

// do some checks here
...

// clear idle emulation
await page.emulateIdleState();
```

    ---
sidebar_label: Page.emulateMediaFeatures
---

# Page.emulateMediaFeatures() method

### Signature

```typescript
class Page {
  abstract emulateMediaFeatures(features?: MediaFeature[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

features

</td><td>

[MediaFeature](./puppeteer.mediafeature.md)\[\]

</td><td>

_(Optional)_ `<?Array<Object>>` Given an array of media feature objects, emulates CSS media features on the page. Each media feature object must have the following properties:

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

```ts
await page.emulateMediaFeatures([
  {name: 'prefers-color-scheme', value: 'dark'},
]);
await page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches);
// → true
await page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);
// → false

await page.emulateMediaFeatures([
  {name: 'prefers-reduced-motion', value: 'reduce'},
]);
await page.evaluate(
  () => matchMedia('(prefers-reduced-motion: reduce)').matches,
);
// → true
await page.evaluate(
  () => matchMedia('(prefers-reduced-motion: no-preference)').matches,
);
// → false

await page.emulateMediaFeatures([
  {name: 'prefers-color-scheme', value: 'dark'},
  {name: 'prefers-reduced-motion', value: 'reduce'},
]);
await page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches);
// → true
await page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);
// → false
await page.evaluate(
  () => matchMedia('(prefers-reduced-motion: reduce)').matches,
);
// → true
await page.evaluate(
  () => matchMedia('(prefers-reduced-motion: no-preference)').matches,
);
// → false

await page.emulateMediaFeatures([{name: 'color-gamut', value: 'p3'}]);
await page.evaluate(() => matchMedia('(color-gamut: srgb)').matches);
// → true
await page.evaluate(() => matchMedia('(color-gamut: p3)').matches);
// → true
await page.evaluate(() => matchMedia('(color-gamut: rec2020)').matches);
// → false
```

    ---
sidebar_label: Page.emulateMediaType
---

# Page.emulateMediaType() method

### Signature

```typescript
class Page {
  abstract emulateMediaType(type?: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

string

</td><td>

_(Optional)_ Changes the CSS media type of the page. The only allowed values are `screen`, `print` and `null`. Passing `null` disables CSS media emulation.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

```ts
await page.evaluate(() => matchMedia('screen').matches);
// → true
await page.evaluate(() => matchMedia('print').matches);
// → false

await page.emulateMediaType('print');
await page.evaluate(() => matchMedia('screen').matches);
// → false
await page.evaluate(() => matchMedia('print').matches);
// → true

await page.emulateMediaType(null);
await page.evaluate(() => matchMedia('screen').matches);
// → true
await page.evaluate(() => matchMedia('print').matches);
// → false
```

    ---
sidebar_label: Page.emulateNetworkConditions
---

# Page.emulateNetworkConditions() method

This does not affect WebSockets and WebRTC PeerConnections (see https://crbug.com/563644). To set the page offline, you can use [Page.setOfflineMode()](./puppeteer.page.setofflinemode.md).

A list of predefined network conditions can be used by importing [PredefinedNetworkConditions](./puppeteer.predefinednetworkconditions.md).

### Signature

```typescript
class Page {
  abstract emulateNetworkConditions(
    networkConditions: NetworkConditions | null,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

networkConditions

</td><td>

[NetworkConditions](./puppeteer.networkconditions.md) \| null

</td><td>

Passing `null` disables network condition emulation.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

```ts
import {PredefinedNetworkConditions} from 'puppeteer';
const slow3G = PredefinedNetworkConditions['Slow 3G'];

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.emulateNetworkConditions(slow3G);
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();
```

    ---
sidebar_label: Page.emulateTimezone
---

# Page.emulateTimezone() method

### Signature

```typescript
class Page {
  abstract emulateTimezone(timezoneId?: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

timezoneId

</td><td>

string

</td><td>

_(Optional)_ Changes the timezone of the page. See [ICU’s metaZones.txt](https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt) for a list of supported timezone IDs. Passing `null` disables timezone emulation.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.emulateVisionDeficiency
---

# Page.emulateVisionDeficiency() method

Simulates the given vision deficiency on the page.

### Signature

```typescript
class Page {
  abstract emulateVisionDeficiency(
    type?: Protocol.Emulation.SetEmulatedVisionDeficiencyRequest['type'],
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

type

</td><td>

Protocol.Emulation.SetEmulatedVisionDeficiencyRequest\['type'\]

</td><td>

_(Optional)_ the type of deficiency to simulate, or `'none'` to reset.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://v8.dev/blog/10-years');

  await page.emulateVisionDeficiency('achromatopsia');
  await page.screenshot({path: 'achromatopsia.png'});

  await page.emulateVisionDeficiency('deuteranopia');
  await page.screenshot({path: 'deuteranopia.png'});

  await page.emulateVisionDeficiency('blurredVision');
  await page.screenshot({path: 'blurred-vision.png'});

  await page.emulateVisionDeficiency('reducedContrast');
  await page.screenshot({path: 'reduced-contrast.png'});

  await browser.close();
})();
```

    ---
sidebar_label: Page.evaluate
---

# Page.evaluate() method

Evaluates a function in the page's context and returns the result.

If the function passed to `page.evaluate` returns a Promise, the function will wait for the promise to resolve and return its value.

### Signature

```typescript
class Page {
  evaluate<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(
    pageFunction: Func | string,
    ...args: Params
  ): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

a function that is run within the page

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

arguments to be passed to the pageFunction

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

the return value of `pageFunction`.

## Example 1

```ts
const result = await frame.evaluate(() => {
  return Promise.resolve(8 * 7);
});
console.log(result); // prints "56"
```

You can pass a string instead of a function (although functions are recommended as they are easier to debug and use with TypeScript):

## Example 2

```ts
const aHandle = await page.evaluate('1 + 2');
```

To get the best TypeScript experience, you should pass in as the generic the type of `pageFunction`:

```ts
const aHandle = await page.evaluate(() => 2);
```

## Example 3

[ElementHandle](./puppeteer.elementhandle.md) instances (including [JSHandle](./puppeteer.jshandle.md)s) can be passed as arguments to the `pageFunction`:

```ts
const bodyHandle = await page.$('body');
const html = await page.evaluate(body => body.innerHTML, bodyHandle);
await bodyHandle.dispose();
```

    ---
sidebar_label: Page.evaluateHandle
---

# Page.evaluateHandle() method

### Signature

```typescript
class Page {
  evaluateHandle<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(
    pageFunction: Func | string,
    ...args: Params
  ): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

a function that is run within the page

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

arguments to be passed to the pageFunction

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;&gt;

## Remarks

The only difference between [page.evaluate](./puppeteer.page.evaluate.md) and `page.evaluateHandle` is that `evaluateHandle` will return the value wrapped in an in-page object.

If the function passed to `page.evaluateHandle` returns a Promise, the function will wait for the promise to resolve and return its value.

You can pass a string instead of a function (although functions are recommended as they are easier to debug and use with TypeScript):

## Example 1

```ts
const aHandle = await page.evaluateHandle('document');
```

## Example 2

[JSHandle](./puppeteer.jshandle.md) instances can be passed as arguments to the `pageFunction`:

```ts
const aHandle = await page.evaluateHandle(() => document.body);
const resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);
console.log(await resultHandle.jsonValue());
await resultHandle.dispose();
```

Most of the time this function returns a [JSHandle](./puppeteer.jshandle.md), but if `pageFunction` returns a reference to an element, you instead get an [ElementHandle](./puppeteer.elementhandle.md) back:

## Example 3

```ts
const button = await page.evaluateHandle(() =>
  document.querySelector('button'),
);
// can call `click` because `button` is an `ElementHandle`
await button.click();
```

The TypeScript definitions assume that `evaluateHandle` returns a `JSHandle`, but if you know it's going to return an `ElementHandle`, pass it as the generic argument:

```ts
const button = await page.evaluateHandle<ElementHandle>(...);
```

    ---
sidebar_label: Page.evaluateOnNewDocument
---

# Page.evaluateOnNewDocument() method

Adds a function which would be invoked in one of the following scenarios:

- whenever the page is navigated

- whenever the child frame is attached or navigated. In this case, the function is invoked in the context of the newly attached frame.

The function is invoked after the document was created but before any of its scripts were run. This is useful to amend the JavaScript environment, e.g. to seed `Math.random`.

### Signature

```typescript
class Page {
  abstract evaluateOnNewDocument<
    Params extends unknown[],
    Func extends (...args: Params) => unknown = (...args: Params) => unknown,
  >(
    pageFunction: Func | string,
    ...args: Params
  ): Promise<NewDocumentScriptEvaluation>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

Function to be evaluated in browser context

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

Arguments to pass to `pageFunction`

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[NewDocumentScriptEvaluation](./puppeteer.newdocumentscriptevaluation.md)&gt;

## Example

An example of overriding the navigator.languages property before the page loads:

```ts
// preload.js

// overwrite the `languages` property to use a custom getter
Object.defineProperty(navigator, 'languages', {
  get: function () {
    return ['en-US', 'en', 'bn'];
  },
});

// In your puppeteer script, assuming the preload.js file is
// in same folder of our script.
const preloadFile = fs.readFileSync('./preload.js', 'utf8');
await page.evaluateOnNewDocument(preloadFile);
```

    ---
sidebar_label: Page.exposeFunction
---

# Page.exposeFunction() method

The method adds a function called `name` on the page's `window` object. When called, the function executes `puppeteerFunction` in node.js and returns a `Promise` which resolves to the return value of `puppeteerFunction`.

If the puppeteerFunction returns a `Promise`, it will be awaited.

:::note

Functions installed via `page.exposeFunction` survive navigations.

:::

### Signature

```typescript
class Page {
  abstract exposeFunction(
    name: string,
    pptrFunction:
      | Function
      | {
          default: Function;
        },
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

name

</td><td>

string

</td><td>

Name of the function on the window object

</td></tr>
<tr><td>

pptrFunction

</td><td>

Function \| &#123; default: Function; &#125;

</td><td>

Callback function which will be called in Puppeteer's context.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example 1

An example of adding an `md5` function into the page:

```ts
import puppeteer from 'puppeteer';
import crypto from 'crypto';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  page.on('console', msg => console.log(msg.text()));
  await page.exposeFunction('md5', text =>
    crypto.createHash('md5').update(text).digest('hex'),
  );
  await page.evaluate(async () => {
    // use window.md5 to compute hashes
    const myString = 'PUPPETEER';
    const myHash = await window.md5(myString);
    console.log(`md5 of ${myString} is ${myHash}`);
  });
  await browser.close();
})();
```

## Example 2

An example of adding a `window.readfile` function into the page:

```ts
import puppeteer from 'puppeteer';
import fs from 'node:fs';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  page.on('console', msg => console.log(msg.text()));
  await page.exposeFunction('readfile', async filePath => {
    return new Promise((resolve, reject) => {
      fs.readFile(filePath, 'utf8', (err, text) => {
        if (err) reject(err);
        else resolve(text);
      });
    });
  });
  await page.evaluate(async () => {
    // use window.readfile to read contents of a file
    const content = await window.readfile('/etc/hosts');
    console.log(content);
  });
  await browser.close();
})();
```

    ---
sidebar_label: Page.focus
---

# Page.focus() method

This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the method throws an error.

### Signature

```typescript
class Page {
  focus(selector: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax). If there are multiple elements satisfying the selector, the first will be focused.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

Promise which resolves when the element matching selector is successfully focused. The promise will be rejected if there is no element matching selector.

## Remarks

Shortcut for [page.mainFrame().focus(selector)](./puppeteer.frame.focus.md).

    ---
sidebar_label: Page.frames
---

# Page.frames() method

An array of all frames attached to the page.

### Signature

```typescript
class Page {
  abstract frames(): Frame[];
}
```

**Returns:**

[Frame](./puppeteer.frame.md)\[\]

    ---
sidebar_label: Page.getDefaultNavigationTimeout
---

# Page.getDefaultNavigationTimeout() method

Maximum navigation time in milliseconds.

### Signature

```typescript
class Page {
  abstract getDefaultNavigationTimeout(): number;
}
```

**Returns:**

number

    ---
sidebar_label: Page.getDefaultTimeout
---

# Page.getDefaultTimeout() method

Maximum time in milliseconds.

### Signature

```typescript
class Page {
  abstract getDefaultTimeout(): number;
}
```

**Returns:**

number

    ---
sidebar_label: Page.goBack
---

# Page.goBack() method

This method navigate to the previous page in history.

### Signature

```typescript
class Page {
  abstract goBack(options?: WaitForOptions): Promise<HTTPResponse | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitForOptions](./puppeteer.waitforoptions.md)

</td><td>

_(Optional)_ Navigation parameters

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md) \| null&gt;

Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If the navigation is same page, returns null. If no history entry is found throws.

    ---
sidebar_label: Page.goForward
---

# Page.goForward() method

This method navigate to the next page in history.

### Signature

```typescript
class Page {
  abstract goForward(options?: WaitForOptions): Promise<HTTPResponse | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitForOptions](./puppeteer.waitforoptions.md)

</td><td>

_(Optional)_ Navigation Parameter

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md) \| null&gt;

Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If the navigation is same page, returns null. If no history entry is found throws.

    ---
sidebar_label: Page.goto
---

# Page.goto() method

Navigates the frame or page to the given `url`.

### Signature

```typescript
class Page {
  goto(url: string, options?: GoToOptions): Promise<HTTPResponse | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

url

</td><td>

string

</td><td>

URL to navigate the frame to. The URL should include scheme, e.g. `https://`

</td></tr>
<tr><td>

options

</td><td>

[GoToOptions](./puppeteer.gotooptions.md)

</td><td>

_(Optional)_ Options to configure waiting behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md) \| null&gt;

A promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.

## Remarks

Navigation to `about:blank` or navigation to the same URL with a different hash will succeed and return `null`.

:::warning

Headless shell mode doesn't support navigation to a PDF document. See the [upstream issue](https://crbug.com/761295).

:::

In headless shell, this method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [HTTPResponse.status()](./puppeteer.httpresponse.status.md).

    ---
sidebar_label: Page.hover
---

# Page.hover() method

This method fetches an element with `selector`, scrolls it into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to hover over the center of the element. If there's no element matching `selector`, the method throws an error.

### Signature

```typescript
class Page {
  hover(selector: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax). If there are multiple elements satisfying the `selector`, the first will be hovered.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

Promise which resolves when the element matching `selector` is successfully hovered. Promise gets rejected if there's no element matching `selector`.

## Remarks

Shortcut for [page.mainFrame().hover(selector)](./puppeteer.page.hover.md).

    ---
sidebar_label: Page.isClosed
---

# Page.isClosed() method

Indicates that the page has been closed.

### Signature

```typescript
class Page {
  abstract isClosed(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: Page.isDragInterceptionEnabled
---

# Page.isDragInterceptionEnabled() method

> Warning: This API is now obsolete.
>
> We no longer support intercepting drag payloads. Use the new drag APIs found on [ElementHandle](./puppeteer.elementhandle.md) to drag (or just use the [Page.mouse](./puppeteer.page.md#mouse)).

`true` if drag events are being intercepted, `false` otherwise.

### Signature

```typescript
class Page {
  abstract isDragInterceptionEnabled(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: Page.isJavaScriptEnabled
---

# Page.isJavaScriptEnabled() method

`true` if the page has JavaScript enabled, `false` otherwise.

### Signature

```typescript
class Page {
  abstract isJavaScriptEnabled(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: Page.isServiceWorkerBypassed
---

# Page.isServiceWorkerBypassed() method

`true` if the service worker are being bypassed, `false` otherwise.

### Signature

```typescript
class Page {
  abstract isServiceWorkerBypassed(): boolean;
}
```

**Returns:**

boolean

    ---
sidebar_label: Page.locator
---

# Page.locator() method

<h2 id="locator">locator(): Locator&lt;NodeFor&lt;Selector&gt;&gt;</h2>

Creates a locator for the provided selector. See [Locator](./puppeteer.locator.md) for details and supported actions.

### Signature

```typescript
class Page {
  locator<Selector extends string>(
    selector: Selector,
  ): Locator<NodeFor<Selector>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt;

<h2 id="locator-1">locator(): Locator&lt;Ret&gt;</h2>

Creates a locator for the provided function. See [Locator](./puppeteer.locator.md) for details and supported actions.

### Signature

```typescript
class Page {
  locator<Ret>(func: () => Awaitable<Ret>): Locator<Ret>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

func

</td><td>

() =&gt; [Awaitable](./puppeteer.awaitable.md)&lt;Ret&gt;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Locator](./puppeteer.locator.md)&lt;Ret&gt;

    ---
sidebar_label: Page.mainFrame
---

# Page.mainFrame() method

The page's main frame.

### Signature

```typescript
class Page {
  abstract mainFrame(): Frame;
}
```

**Returns:**

[Frame](./puppeteer.frame.md)

    ---
sidebar_label: Page
---

# Page class

Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in the browser.

:::note

One Browser instance might have multiple Page instances.

:::

### Signature

```typescript
export declare abstract class Page extends EventEmitter<PageEvents>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[PageEvents](./puppeteer.pageevents.md)&gt;

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Page` class.

## Example 1

This example creates a page, navigates it to a URL, and then saves a screenshot:

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({path: 'screenshot.png'});
  await browser.close();
})();
```

The Page class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [PageEvent](./puppeteer.pageevent.md) enum.

## Example 2

This example logs a message for a single page `load` event:

```ts
page.once('load', () => console.log('Page loaded!'));
```

To unsubscribe from events use the [EventEmitter.off()](./puppeteer.eventemitter.off.md) method:

```ts
function logRequest(interceptedRequest) {
  console.log('A request was made:', interceptedRequest.url());
}
page.on('request', logRequest);
// Sometime later...
page.off('request', logRequest);
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="accessibility">accessibility</span>

</td><td>

`readonly`

</td><td>

[Accessibility](./puppeteer.accessibility.md)

</td><td>

The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access).

**Remarks:**

Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output.

Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree.

Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class.

</td></tr>
<tr><td>

<span id="coverage">coverage</span>

</td><td>

`readonly`

</td><td>

[Coverage](./puppeteer.coverage.md)

</td><td>

The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page.

**Remarks:**

To output coverage in a form consumable by [Istanbul](https://github.com/istanbuljs), see [puppeteer-to-istanbul](https://github.com/istanbuljs/puppeteer-to-istanbul).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Coverage` class.

</td></tr>
<tr><td>

<span id="keyboard">keyboard</span>

</td><td>

`readonly`

</td><td>

[Keyboard](./puppeteer.keyboard.md)

</td><td>

Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page.

**Remarks:**

For finer control, you can use [Keyboard.down()](./puppeteer.keyboard.down.md), [Keyboard.up()](./puppeteer.keyboard.up.md), and [Keyboard.sendCharacter()](./puppeteer.keyboard.sendcharacter.md) to manually fire events as if they were generated from a real keyboard.

On macOS, keyboard shortcuts like `⌘ A` -&gt; Select All do not work. See [\#1313](https://github.com/puppeteer/puppeteer/issues/1313).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Keyboard` class.

</td></tr>
<tr><td>

<span id="mouse">mouse</span>

</td><td>

`readonly`

</td><td>

[Mouse](./puppeteer.mouse.md)

</td><td>

The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.

**Remarks:**

Every `page` object has its own Mouse, accessible with [Page.mouse](./puppeteer.page.md#mouse).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Mouse` class.

</td></tr>
<tr><td>

<span id="touchscreen">touchscreen</span>

</td><td>

`readonly`

</td><td>

[Touchscreen](./puppeteer.touchscreen.md)

</td><td>

The Touchscreen class exposes touchscreen events.

</td></tr>
<tr><td>

<span id="tracing">tracing</span>

</td><td>

`readonly`

</td><td>

[Tracing](./puppeteer.tracing.md)

</td><td>

The Tracing class exposes the tracing audit interface.

**Remarks:**

You can use `tracing.start` and `tracing.stop` to create a trace file which can be opened in Chrome DevTools or [timeline viewer](https://chromedevtools.github.io/timeline-viewer/).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Tracing` class.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_">[$(selector)](./puppeteer.page._.md)</span>

</td><td>

</td><td>

Finds the first element that matches the selector. If no element matches the selector, the return value resolves to `null`.

**Remarks:**

Shortcut for [Page.mainFrame().$(selector)](./puppeteer.frame._.md).

</td></tr>
<tr><td>

<span id="__">[$$(selector, options)](./puppeteer.page.__.md)</span>

</td><td>

</td><td>

Finds elements on the page that match the selector. If no elements match the selector, the return value resolves to `[]`.

**Remarks:**

Shortcut for [Page.mainFrame().$$(selector)](./puppeteer.frame.__.md).

</td></tr>
<tr><td>

<span id="__eval">[$$eval(selector, pageFunction, args)](./puppeteer.page.__eval.md)</span>

</td><td>

</td><td>

This method returns all elements matching the selector and passes the resulting array as the first argument to the `pageFunction`.

**Remarks:**

If `pageFunction` returns a promise `$$eval` will wait for the promise to resolve and then return its value.

</td></tr>
<tr><td>

<span id="_eval">[$eval(selector, pageFunction, args)](./puppeteer.page._eval.md)</span>

</td><td>

</td><td>

This method finds the first element within the page that matches the selector and passes the result as the first argument to the `pageFunction`.

**Remarks:**

If no element is found matching `selector`, the method will throw an error.

If `pageFunction` returns a promise `$eval` will wait for the promise to resolve and then return its value.

</td></tr>
<tr><td>

<span id="addscripttag">[addScriptTag(options)](./puppeteer.page.addscripttag.md)</span>

</td><td>

</td><td>

Adds a `<script>` tag into the page with the desired URL or content.

**Remarks:**

Shortcut for [page.mainFrame().addScriptTag(options)](./puppeteer.frame.addscripttag.md).

</td></tr>
<tr><td>

<span id="addstyletag">[addStyleTag(options)](./puppeteer.page.addstyletag.md)</span>

</td><td>

</td><td>

Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a `<style type="text/css">` tag with the content.

Shortcut for [page.mainFrame().addStyleTag(options)](./puppeteer.frame.addstyletag.md).

</td></tr>
<tr><td>

<span id="addstyletag">[addStyleTag(options)](./puppeteer.page.addstyletag.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="authenticate">[authenticate(credentials)](./puppeteer.page.authenticate.md)</span>

</td><td>

</td><td>

Provide credentials for `HTTP authentication`.

:::note

Request interception will be turned on behind the scenes to implement authentication. This might affect performance.

:::

**Remarks:**

To disable authentication, pass `null`.

</td></tr>
<tr><td>

<span id="bringtofront">[bringToFront()](./puppeteer.page.bringtofront.md)</span>

</td><td>

</td><td>

Brings page to front (activates tab).

</td></tr>
<tr><td>

<span id="browser">[browser()](./puppeteer.page.browser.md)</span>

</td><td>

</td><td>

Get the browser the page belongs to.

</td></tr>
<tr><td>

<span id="browsercontext">[browserContext()](./puppeteer.page.browsercontext.md)</span>

</td><td>

</td><td>

Get the browser context that the page belongs to.

</td></tr>
<tr><td>

<span id="click">[click(selector, options)](./puppeteer.page.click.md)</span>

</td><td>

</td><td>

This method fetches an element with `selector`, scrolls it into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to click in the center of the element. If there's no element matching `selector`, the method throws an error.

**Remarks:**

Bear in mind that if `click()` triggers a navigation event and there's a separate `page.waitForNavigation()` promise to be resolved, you may end up with a race condition that yields unexpected results. The correct pattern for click and wait for navigation is the following:

```ts
const [response] = await Promise.all([
  page.waitForNavigation(waitOptions),
  page.click(selector, clickOptions),
]);
```

Shortcut for [page.mainFrame().click(selector\[, options\])](./puppeteer.frame.click.md).

</td></tr>
<tr><td>

<span id="close">[close(options)](./puppeteer.page.close.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="content">[content()](./puppeteer.page.content.md)</span>

</td><td>

</td><td>

The full HTML contents of the page, including the DOCTYPE.

</td></tr>
<tr><td>

<span id="cookies">[cookies(urls)](./puppeteer.page.cookies.md)</span>

</td><td>

`deprecated`

</td><td>

If no URLs are specified, this method returns cookies for the current page URL. If URLs are specified, only cookies for those URLs are returned.

**Deprecated:**

Page-level cookie API is deprecated. Use [Browser.cookies()](./puppeteer.browser.cookies.md) or [BrowserContext.cookies()](./puppeteer.browsercontext.cookies.md) instead.

</td></tr>
<tr><td>

<span id="createcdpsession">[createCDPSession()](./puppeteer.page.createcdpsession.md)</span>

</td><td>

</td><td>

Creates a Chrome Devtools Protocol session attached to the page.

</td></tr>
<tr><td>

<span id="createpdfstream">[createPDFStream(options)](./puppeteer.page.createpdfstream.md)</span>

</td><td>

</td><td>

Generates a PDF of the page with the `print` CSS media type.

**Remarks:**

To generate a PDF with the `screen` media type, call [\`page.emulateMediaType('screen')\`](./puppeteer.page.emulatemediatype.md) before calling `page.pdf()`.

By default, `page.pdf()` generates a pdf with modified colors for printing. Use the [\`-webkit-print-color-adjust\`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to force rendering of exact colors.

</td></tr>
<tr><td>

<span id="deletecookie">[deleteCookie(cookies)](./puppeteer.page.deletecookie.md)</span>

</td><td>

`deprecated`

</td><td>

**Deprecated:**

Page-level cookie API is deprecated. Use [Browser.deleteCookie()](./puppeteer.browser.deletecookie.md) or [BrowserContext.deleteCookie()](./puppeteer.browsercontext.deletecookie.md) instead.

</td></tr>
<tr><td>

<span id="emulate">[emulate(device)](./puppeteer.page.emulate.md)</span>

</td><td>

</td><td>

Emulates a given device's metrics and user agent.

To aid emulation, Puppeteer provides a list of known devices that can be via [KnownDevices](./puppeteer.knowndevices.md).

**Remarks:**

This method is a shortcut for calling two methods: [Page.setUserAgent()](./puppeteer.page.setuseragent.md) and [Page.setViewport()](./puppeteer.page.setviewport.md).

This method will resize the page. A lot of websites don't expect phones to change size, so you should emulate before navigating to the page.

</td></tr>
<tr><td>

<span id="emulatecputhrottling">[emulateCPUThrottling(factor)](./puppeteer.page.emulatecputhrottling.md)</span>

</td><td>

</td><td>

Enables CPU throttling to emulate slow CPUs.

</td></tr>
<tr><td>

<span id="emulateidlestate">[emulateIdleState(overrides)](./puppeteer.page.emulateidlestate.md)</span>

</td><td>

</td><td>

Emulates the idle state. If no arguments set, clears idle state emulation.

</td></tr>
<tr><td>

<span id="emulatemediafeatures">[emulateMediaFeatures(features)](./puppeteer.page.emulatemediafeatures.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="emulatemediatype">[emulateMediaType(type)](./puppeteer.page.emulatemediatype.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="emulatenetworkconditions">[emulateNetworkConditions(networkConditions)](./puppeteer.page.emulatenetworkconditions.md)</span>

</td><td>

</td><td>

This does not affect WebSockets and WebRTC PeerConnections (see https://crbug.com/563644). To set the page offline, you can use [Page.setOfflineMode()](./puppeteer.page.setofflinemode.md).

A list of predefined network conditions can be used by importing [PredefinedNetworkConditions](./puppeteer.predefinednetworkconditions.md).

</td></tr>
<tr><td>

<span id="emulatetimezone">[emulateTimezone(timezoneId)](./puppeteer.page.emulatetimezone.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="emulatevisiondeficiency">[emulateVisionDeficiency(type)](./puppeteer.page.emulatevisiondeficiency.md)</span>

</td><td>

</td><td>

Simulates the given vision deficiency on the page.

</td></tr>
<tr><td>

<span id="evaluate">[evaluate(pageFunction, args)](./puppeteer.page.evaluate.md)</span>

</td><td>

</td><td>

Evaluates a function in the page's context and returns the result.

If the function passed to `page.evaluate` returns a Promise, the function will wait for the promise to resolve and return its value.

</td></tr>
<tr><td>

<span id="evaluatehandle">[evaluateHandle(pageFunction, args)](./puppeteer.page.evaluatehandle.md)</span>

</td><td>

</td><td>

**Remarks:**

The only difference between [page.evaluate](./puppeteer.page.evaluate.md) and `page.evaluateHandle` is that `evaluateHandle` will return the value wrapped in an in-page object.

If the function passed to `page.evaluateHandle` returns a Promise, the function will wait for the promise to resolve and return its value.

You can pass a string instead of a function (although functions are recommended as they are easier to debug and use with TypeScript):

</td></tr>
<tr><td>

<span id="evaluateonnewdocument">[evaluateOnNewDocument(pageFunction, args)](./puppeteer.page.evaluateonnewdocument.md)</span>

</td><td>

</td><td>

Adds a function which would be invoked in one of the following scenarios:

- whenever the page is navigated

- whenever the child frame is attached or navigated. In this case, the function is invoked in the context of the newly attached frame.

The function is invoked after the document was created but before any of its scripts were run. This is useful to amend the JavaScript environment, e.g. to seed `Math.random`.

</td></tr>
<tr><td>

<span id="exposefunction">[exposeFunction(name, pptrFunction)](./puppeteer.page.exposefunction.md)</span>

</td><td>

</td><td>

The method adds a function called `name` on the page's `window` object. When called, the function executes `puppeteerFunction` in node.js and returns a `Promise` which resolves to the return value of `puppeteerFunction`.

If the puppeteerFunction returns a `Promise`, it will be awaited.

:::note

Functions installed via `page.exposeFunction` survive navigations.

:::

</td></tr>
<tr><td>

<span id="focus">[focus(selector)](./puppeteer.page.focus.md)</span>

</td><td>

</td><td>

This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the method throws an error.

**Remarks:**

Shortcut for [page.mainFrame().focus(selector)](./puppeteer.frame.focus.md).

</td></tr>
<tr><td>

<span id="frames">[frames()](./puppeteer.page.frames.md)</span>

</td><td>

</td><td>

An array of all frames attached to the page.

</td></tr>
<tr><td>

<span id="getdefaultnavigationtimeout">[getDefaultNavigationTimeout()](./puppeteer.page.getdefaultnavigationtimeout.md)</span>

</td><td>

</td><td>

Maximum navigation time in milliseconds.

</td></tr>
<tr><td>

<span id="getdefaulttimeout">[getDefaultTimeout()](./puppeteer.page.getdefaulttimeout.md)</span>

</td><td>

</td><td>

Maximum time in milliseconds.

</td></tr>
<tr><td>

<span id="goback">[goBack(options)](./puppeteer.page.goback.md)</span>

</td><td>

</td><td>

This method navigate to the previous page in history.

</td></tr>
<tr><td>

<span id="goforward">[goForward(options)](./puppeteer.page.goforward.md)</span>

</td><td>

</td><td>

This method navigate to the next page in history.

</td></tr>
<tr><td>

<span id="goto">[goto(url, options)](./puppeteer.page.goto.md)</span>

</td><td>

</td><td>

Navigates the frame or page to the given `url`.

**Remarks:**

Navigation to `about:blank` or navigation to the same URL with a different hash will succeed and return `null`.

:::warning

Headless shell mode doesn't support navigation to a PDF document. See the [upstream issue](https://crbug.com/761295).

:::

In headless shell, this method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [HTTPResponse.status()](./puppeteer.httpresponse.status.md).

</td></tr>
<tr><td>

<span id="hover">[hover(selector)](./puppeteer.page.hover.md)</span>

</td><td>

</td><td>

This method fetches an element with `selector`, scrolls it into view if needed, and then uses [Page.mouse](./puppeteer.page.md#mouse) to hover over the center of the element. If there's no element matching `selector`, the method throws an error.

**Remarks:**

Shortcut for [page.mainFrame().hover(selector)](./puppeteer.page.hover.md).

</td></tr>
<tr><td>

<span id="isclosed">[isClosed()](./puppeteer.page.isclosed.md)</span>

</td><td>

</td><td>

Indicates that the page has been closed.

</td></tr>
<tr><td>

<span id="isdraginterceptionenabled">[isDragInterceptionEnabled()](./puppeteer.page.isdraginterceptionenabled.md)</span>

</td><td>

`deprecated`

</td><td>

`true` if drag events are being intercepted, `false` otherwise.

**Deprecated:**

We no longer support intercepting drag payloads. Use the new drag APIs found on [ElementHandle](./puppeteer.elementhandle.md) to drag (or just use the [Page.mouse](./puppeteer.page.md#mouse)).

</td></tr>
<tr><td>

<span id="isjavascriptenabled">[isJavaScriptEnabled()](./puppeteer.page.isjavascriptenabled.md)</span>

</td><td>

</td><td>

`true` if the page has JavaScript enabled, `false` otherwise.

</td></tr>
<tr><td>

<span id="isserviceworkerbypassed">[isServiceWorkerBypassed()](./puppeteer.page.isserviceworkerbypassed.md)</span>

</td><td>

</td><td>

`true` if the service worker are being bypassed, `false` otherwise.

</td></tr>
<tr><td>

<span id="locator">[locator(selector)](./puppeteer.page.locator.md)</span>

</td><td>

</td><td>

Creates a locator for the provided selector. See [Locator](./puppeteer.locator.md) for details and supported actions.

</td></tr>
<tr><td>

<span id="locator">[locator(func)](./puppeteer.page.locator.md)</span>

</td><td>

</td><td>

Creates a locator for the provided function. See [Locator](./puppeteer.locator.md) for details and supported actions.

</td></tr>
<tr><td>

<span id="mainframe">[mainFrame()](./puppeteer.page.mainframe.md)</span>

</td><td>

</td><td>

The page's main frame.

</td></tr>
<tr><td>

<span id="metrics">[metrics()](./puppeteer.page.metrics.md)</span>

</td><td>

</td><td>

Object containing metrics as key/value pairs.

**Remarks:**

All timestamps are in monotonic time: monotonically increasing time in seconds since an arbitrary point in the past.

</td></tr>
<tr><td>

<span id="pdf">[pdf(options)](./puppeteer.page.pdf.md)</span>

</td><td>

</td><td>

Generates a PDF of the page with the `print` CSS media type.

**Remarks:**

To generate a PDF with the `screen` media type, call [\`page.emulateMediaType('screen')\`](./puppeteer.page.emulatemediatype.md) before calling `page.pdf()`.

By default, `page.pdf()` generates a pdf with modified colors for printing. Use the [\`-webkit-print-color-adjust\`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to force rendering of exact colors.

</td></tr>
<tr><td>

<span id="queryobjects">[queryObjects(prototypeHandle)](./puppeteer.page.queryobjects.md)</span>

</td><td>

</td><td>

This method iterates the JavaScript heap and finds all objects with the given prototype.

</td></tr>
<tr><td>

<span id="reload">[reload(options)](./puppeteer.page.reload.md)</span>

</td><td>

</td><td>

Reloads the page.

</td></tr>
<tr><td>

<span id="removeexposedfunction">[removeExposedFunction(name)](./puppeteer.page.removeexposedfunction.md)</span>

</td><td>

</td><td>

The method removes a previously added function via $[Page.exposeFunction()](./puppeteer.page.exposefunction.md) called `name` from the page's `window` object.

</td></tr>
<tr><td>

<span id="removescripttoevaluateonnewdocument">[removeScriptToEvaluateOnNewDocument(identifier)](./puppeteer.page.removescripttoevaluateonnewdocument.md)</span>

</td><td>

</td><td>

Removes script that injected into page by Page.evaluateOnNewDocument.

</td></tr>
<tr><td>

<span id="screencast">[screencast(options)](./puppeteer.page.screencast.md)</span>

</td><td>

</td><td>

**_(Experimental)_** Captures a screencast of this [page](./puppeteer.page.md).

**Remarks:**

By default, all recordings will be [WebM](https://www.webmproject.org/) format using the [VP9](https://www.webmproject.org/vp9/) video codec, with a frame rate of 30 FPS.

You must have [ffmpeg](https://ffmpeg.org/) installed on your system.

</td></tr>
<tr><td>

<span id="screenshot">[screenshot(options)](./puppeteer.page.screenshot.md)</span>

</td><td>

</td><td>

Captures a screenshot of this [page](./puppeteer.page.md).

**Remarks:**

While a screenshot is being taken in a [BrowserContext](./puppeteer.browsercontext.md), the following methods will automatically wait for the screenshot to finish to prevent interference with the screenshot process: [BrowserContext.newPage()](./puppeteer.browsercontext.newpage.md), [Browser.newPage()](./puppeteer.browser.newpage.md), [Page.close()](./puppeteer.page.close.md).

Calling [Page.bringToFront()](./puppeteer.page.bringtofront.md) will not wait for existing screenshot operations.

</td></tr>
<tr><td>

<span id="screenshot">[screenshot(options)](./puppeteer.page.screenshot.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="select">[select(selector, values)](./puppeteer.page.select.md)</span>

</td><td>

</td><td>

Triggers a `change` and `input` event once all the provided options have been selected. If there's no `<select>` element matching `selector`, the method throws an error.

**Remarks:**

Shortcut for [page.mainFrame().select()](./puppeteer.frame.select.md)

</td></tr>
<tr><td>

<span id="setbypasscsp">[setBypassCSP(enabled)](./puppeteer.page.setbypasscsp.md)</span>

</td><td>

</td><td>

Toggles bypassing page's Content-Security-Policy.

**Remarks:**

NOTE: CSP bypassing happens at the moment of CSP initialization rather than evaluation. Usually, this means that `page.setBypassCSP` should be called before navigating to the domain.

</td></tr>
<tr><td>

<span id="setbypassserviceworker">[setBypassServiceWorker(bypass)](./puppeteer.page.setbypassserviceworker.md)</span>

</td><td>

</td><td>

Toggles ignoring of service worker for each request.

</td></tr>
<tr><td>

<span id="setcacheenabled">[setCacheEnabled(enabled)](./puppeteer.page.setcacheenabled.md)</span>

</td><td>

</td><td>

Toggles ignoring cache for each request based on the enabled state. By default, caching is enabled.

</td></tr>
<tr><td>

<span id="setcontent">[setContent(html, options)](./puppeteer.page.setcontent.md)</span>

</td><td>

</td><td>

Set the content of the page.

</td></tr>
<tr><td>

<span id="setcookie">[setCookie(cookies)](./puppeteer.page.setcookie.md)</span>

</td><td>

`deprecated`

</td><td>

**Deprecated:**

Page-level cookie API is deprecated. Use [Browser.setCookie()](./puppeteer.browser.setcookie.md) or [BrowserContext.setCookie()](./puppeteer.browsercontext.setcookie.md) instead.

</td></tr>
<tr><td>

<span id="setdefaultnavigationtimeout">[setDefaultNavigationTimeout(timeout)](./puppeteer.page.setdefaultnavigationtimeout.md)</span>

</td><td>

</td><td>

This setting will change the default maximum navigation time for the following methods and related shortcuts:

- [page.goBack(options)](./puppeteer.page.goback.md)

- [page.goForward(options)](./puppeteer.page.goforward.md)

- [page.goto(url,options)](./puppeteer.page.goto.md)

- [page.reload(options)](./puppeteer.page.reload.md)

- [page.setContent(html,options)](./puppeteer.page.setcontent.md)

- [page.waitForNavigation(options)](./puppeteer.page.waitfornavigation.md)

</td></tr>
<tr><td>

<span id="setdefaulttimeout">[setDefaultTimeout(timeout)](./puppeteer.page.setdefaulttimeout.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="setdraginterception">[setDragInterception(enabled)](./puppeteer.page.setdraginterception.md)</span>

</td><td>

`deprecated`

</td><td>

**Deprecated:**

We no longer support intercepting drag payloads. Use the new drag APIs found on [ElementHandle](./puppeteer.elementhandle.md) to drag (or just use the [Page.mouse](./puppeteer.page.md#mouse)).

</td></tr>
<tr><td>

<span id="setextrahttpheaders">[setExtraHTTPHeaders(headers)](./puppeteer.page.setextrahttpheaders.md)</span>

</td><td>

</td><td>

The extra HTTP headers will be sent with every request the page initiates.

:::tip

All HTTP header names are lowercased. (HTTP headers are case-insensitive, so this shouldn’t impact your server code.)

:::

:::note

page.setExtraHTTPHeaders does not guarantee the order of headers in the outgoing requests.

:::

</td></tr>
<tr><td>

<span id="setgeolocation">[setGeolocation(options)](./puppeteer.page.setgeolocation.md)</span>

</td><td>

</td><td>

Sets the page's geolocation.

**Remarks:**

Consider using [BrowserContext.overridePermissions()](./puppeteer.browsercontext.overridepermissions.md) to grant permissions for the page to read its geolocation.

</td></tr>
<tr><td>

<span id="setjavascriptenabled">[setJavaScriptEnabled(enabled)](./puppeteer.page.setjavascriptenabled.md)</span>

</td><td>

</td><td>

**Remarks:**

NOTE: changing this value won't affect scripts that have already been run. It will take full effect on the next navigation.

</td></tr>
<tr><td>

<span id="setofflinemode">[setOfflineMode(enabled)](./puppeteer.page.setofflinemode.md)</span>

</td><td>

</td><td>

Sets the network connection to offline.

It does not change the parameters used in [Page.emulateNetworkConditions()](./puppeteer.page.emulatenetworkconditions.md)

</td></tr>
<tr><td>

<span id="setrequestinterception">[setRequestInterception(value)](./puppeteer.page.setrequestinterception.md)</span>

</td><td>

</td><td>

Activating request interception enables [HTTPRequest.abort()](./puppeteer.httprequest.abort.md), [HTTPRequest.continue()](./puppeteer.httprequest.continue.md) and [HTTPRequest.respond()](./puppeteer.httprequest.respond.md) methods. This provides the capability to modify network requests that are made by a page.

Once request interception is enabled, every request will stall unless it's continued, responded or aborted; or completed using the browser cache.

See the [Request interception guide](https://pptr.dev/guides/network-interception) for more details.

</td></tr>
<tr><td>

<span id="setuseragent">[setUserAgent(userAgent, userAgentMetadata)](./puppeteer.page.setuseragent.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="setviewport">[setViewport(viewport)](./puppeteer.page.setviewport.md)</span>

</td><td>

</td><td>

`page.setViewport` will resize the page. A lot of websites don't expect phones to change size, so you should set the viewport before navigating to the page.

In the case of multiple pages in a single browser, each page can have its own viewport size. Setting the viewport to `null` resets the viewport to its default value.

**Remarks:**

NOTE: in certain cases, setting viewport will reload the page in order to set the isMobile or hasTouch properties.

</td></tr>
<tr><td>

<span id="tap">[tap(selector)](./puppeteer.page.tap.md)</span>

</td><td>

</td><td>

This method fetches an element with `selector`, scrolls it into view if needed, and then uses [Page.touchscreen](./puppeteer.page.md#touchscreen) to tap in the center of the element. If there's no element matching `selector`, the method throws an error.

**Remarks:**

Shortcut for [page.mainFrame().tap(selector)](./puppeteer.frame.tap.md).

</td></tr>
<tr><td>

<span id="target">[target()](./puppeteer.page.target.md)</span>

</td><td>

`deprecated`

</td><td>

A target this page was created from.

**Deprecated:**

Use [Page.createCDPSession()](./puppeteer.page.createcdpsession.md) directly.

</td></tr>
<tr><td>

<span id="title">[title()](./puppeteer.page.title.md)</span>

</td><td>

</td><td>

The page's title

**Remarks:**

Shortcut for [page.mainFrame().title()](./puppeteer.frame.title.md).

</td></tr>
<tr><td>

<span id="type">[type(selector, text, options)](./puppeteer.page.type.md)</span>

</td><td>

</td><td>

Sends a `keydown`, `keypress/input`, and `keyup` event for each character in the text.

To press a special key, like `Control` or `ArrowDown`, use [Keyboard.press()](./puppeteer.keyboard.press.md).

</td></tr>
<tr><td>

<span id="url">[url()](./puppeteer.page.url.md)</span>

</td><td>

</td><td>

The page's URL.

**Remarks:**

Shortcut for [page.mainFrame().url()](./puppeteer.frame.url.md).

</td></tr>
<tr><td>

<span id="viewport">[viewport()](./puppeteer.page.viewport.md)</span>

</td><td>

</td><td>

Returns the current page viewport settings without checking the actual page viewport.

This is either the viewport set with the previous [Page.setViewport()](./puppeteer.page.setviewport.md) call or the default viewport set via [ConnectOptions.defaultViewport](./puppeteer.connectoptions.md#defaultviewport).

</td></tr>
<tr><td>

<span id="waitfordeviceprompt">[waitForDevicePrompt(options)](./puppeteer.page.waitfordeviceprompt.md)</span>

</td><td>

</td><td>

This method is typically coupled with an action that triggers a device request from an api such as WebBluetooth.

:::caution

This must be called before the device request is made. It will not return a currently active device prompt.

:::

</td></tr>
<tr><td>

<span id="waitforfilechooser">[waitForFileChooser(options)](./puppeteer.page.waitforfilechooser.md)</span>

</td><td>

</td><td>

This method is typically coupled with an action that triggers file choosing.

:::caution

This must be called before the file chooser is launched. It will not return a currently active file chooser.

:::

:::caution

Interception of file dialogs triggered via DOM APIs such as window.showOpenFilePicker is currently not supported.

:::

**Remarks:**

In the "headful" browser, this method results in the native file picker dialog `not showing up` for the user.

</td></tr>
<tr><td>

<span id="waitforframe">[waitForFrame(urlOrPredicate, options)](./puppeteer.page.waitforframe.md)</span>

</td><td>

</td><td>

Waits for a frame matching the given conditions to appear.

</td></tr>
<tr><td>

<span id="waitforfunction">[waitForFunction(pageFunction, options, args)](./puppeteer.page.waitforfunction.md)</span>

</td><td>

</td><td>

Waits for the provided function, `pageFunction`, to return a truthy value when evaluated in the page's context.

</td></tr>
<tr><td>

<span id="waitfornavigation">[waitForNavigation(options)](./puppeteer.page.waitfornavigation.md)</span>

</td><td>

</td><td>

Waits for the page to navigate to a new URL or to reload. It is useful when you run code that will indirectly cause the page to navigate.

**Remarks:**

Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered a navigation.

</td></tr>
<tr><td>

<span id="waitfornetworkidle">[waitForNetworkIdle(options)](./puppeteer.page.waitfornetworkidle.md)</span>

</td><td>

</td><td>

Waits for the network to be idle.

**Remarks:**

The function will always wait at least the set [IdleTime](./puppeteer.waitfornetworkidleoptions.md#idletime).

</td></tr>
<tr><td>

<span id="waitforrequest">[waitForRequest(urlOrPredicate, options)](./puppeteer.page.waitforrequest.md)</span>

</td><td>

</td><td>

**Remarks:**

Optional Waiting Parameters have:

- `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds, pass `0` to disable the timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method.

</td></tr>
<tr><td>

<span id="waitforresponse">[waitForResponse(urlOrPredicate, options)](./puppeteer.page.waitforresponse.md)</span>

</td><td>

</td><td>

**Remarks:**

Optional Parameter have:

- `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds, pass `0` to disable the timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method.

</td></tr>
<tr><td>

<span id="waitforselector">[waitForSelector(selector, options)](./puppeteer.page.waitforselector.md)</span>

</td><td>

</td><td>

Wait for the `selector` to appear in page. If at the moment of calling the method the `selector` already exists, the method will return immediately. If the `selector` doesn't appear after the `timeout` milliseconds of waiting, the function will throw.

**Remarks:**

The optional Parameter in Arguments `options` are:

- `visible`: A boolean wait for element to be present in DOM and to be visible, i.e. to not have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`.

- `hidden`: Wait for element to not be found in the DOM or to be hidden, i.e. have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`.

- `timeout`: maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method.

</td></tr>
<tr><td>

<span id="workers">[workers()](./puppeteer.page.workers.md)</span>

</td><td>

</td><td>

All of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page.

**Remarks:**

This does not contain ServiceWorkers

</td></tr>
</tbody></table>

    ---
sidebar_label: Page.metrics
---

# Page.metrics() method

Object containing metrics as key/value pairs.

### Signature

```typescript
class Page {
  abstract metrics(): Promise<Metrics>;
}
```

**Returns:**

Promise&lt;[Metrics](./puppeteer.metrics.md)&gt;

- `Timestamp` : The timestamp when the metrics sample was taken.

- `Documents` : Number of documents in the page.

- `Frames` : Number of frames in the page.

- `JSEventListeners` : Number of events in the page.

- `Nodes` : Number of DOM nodes in the page.

- `LayoutCount` : Total number of full or partial page layout.

- `RecalcStyleCount` : Total number of page style recalculations.

- `LayoutDuration` : Combined durations of all page layouts.

- `RecalcStyleDuration` : Combined duration of all page style recalculations.

- `ScriptDuration` : Combined duration of JavaScript execution.

- `TaskDuration` : Combined duration of all tasks performed by the browser.

- `JSHeapUsedSize` : Used JavaScript heap size.

- `JSHeapTotalSize` : Total JavaScript heap size.

## Remarks

All timestamps are in monotonic time: monotonically increasing time in seconds since an arbitrary point in the past.

    ---
sidebar_label: Page.pdf
---

# Page.pdf() method

Generates a PDF of the page with the `print` CSS media type.

### Signature

```typescript
class Page {
  abstract pdf(options?: PDFOptions): Promise<Uint8Array>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[PDFOptions](./puppeteer.pdfoptions.md)

</td><td>

_(Optional)_ options for generating the PDF.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Uint8Array&gt;

## Remarks

To generate a PDF with the `screen` media type, call [\`page.emulateMediaType('screen')\`](./puppeteer.page.emulatemediatype.md) before calling `page.pdf()`.

By default, `page.pdf()` generates a pdf with modified colors for printing. Use the [\`-webkit-print-color-adjust\`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to force rendering of exact colors.

    ---
sidebar_label: Page.queryObjects
---

# Page.queryObjects() method

This method iterates the JavaScript heap and finds all objects with the given prototype.

### Signature

```typescript
class Page {
  abstract queryObjects<Prototype>(
    prototypeHandle: JSHandle<Prototype>,
  ): Promise<JSHandle<Prototype[]>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

prototypeHandle

</td><td>

[JSHandle](./puppeteer.jshandle.md)&lt;Prototype&gt;

</td><td>

a handle to the object prototype.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[JSHandle](./puppeteer.jshandle.md)&lt;Prototype\[\]&gt;&gt;

Promise which resolves to a handle to an array of objects with this prototype.

## Example

```ts
// Create a Map object
await page.evaluate(() => (window.map = new Map()));
// Get a handle to the Map object prototype
const mapPrototype = await page.evaluateHandle(() => Map.prototype);
// Query all map instances into an array
const mapInstances = await page.queryObjects(mapPrototype);
// Count amount of map objects in heap
const count = await page.evaluate(maps => maps.length, mapInstances);
await mapInstances.dispose();
await mapPrototype.dispose();
```

    ---
sidebar_label: Page.reload
---

# Page.reload() method

Reloads the page.

### Signature

```typescript
class Page {
  abstract reload(options?: WaitForOptions): Promise<HTTPResponse | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitForOptions](./puppeteer.waitforoptions.md)

</td><td>

_(Optional)_ Options to configure waiting behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md) \| null&gt;

A promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.

    ---
sidebar_label: Page.removeExposedFunction
---

# Page.removeExposedFunction() method

The method removes a previously added function via $[Page.exposeFunction()](./puppeteer.page.exposefunction.md) called `name` from the page's `window` object.

### Signature

```typescript
class Page {
  abstract removeExposedFunction(name: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

name

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.removeScriptToEvaluateOnNewDocument
---

# Page.removeScriptToEvaluateOnNewDocument() method

Removes script that injected into page by Page.evaluateOnNewDocument.

### Signature

```typescript
class Page {
  abstract removeScriptToEvaluateOnNewDocument(
    identifier: string,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

identifier

</td><td>

string

</td><td>

script identifier

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.screencast
---

# Page.screencast() method

Captures a screencast of this [page](./puppeteer.page.md).

### Signature

```typescript
class Page {
  screencast(options?: Readonly<ScreencastOptions>): Promise<ScreenRecorder>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[ScreencastOptions](./puppeteer.screencastoptions.md)&gt;

</td><td>

_(Optional)_ Configures screencast behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ScreenRecorder](./puppeteer.screenrecorder.md)&gt;

## Remarks

By default, all recordings will be [WebM](https://www.webmproject.org/) format using the [VP9](https://www.webmproject.org/vp9/) video codec, with a frame rate of 30 FPS.

You must have [ffmpeg](https://ffmpeg.org/) installed on your system.

## Example

Recording a [page](./puppeteer.page.md):

```
import puppeteer from 'puppeteer';

// Launch a browser
const browser = await puppeteer.launch();

// Create a new page
const page = await browser.newPage();

// Go to your site.
await page.goto("https://www.example.com");

// Start recording.
const recorder = await page.screencast({path: 'recording.webm'});

// Do something.

// Stop recording.
await recorder.stop();

browser.close();
```

    ---
sidebar_label: Page.screenshot
---

# Page.screenshot() method

<h2 id="screenshot">screenshot(): Promise&lt;string&gt;</h2>

Captures a screenshot of this [page](./puppeteer.page.md).

### Signature

```typescript
class Page {
  screenshot(
    options: Readonly<ScreenshotOptions> & {
      encoding: 'base64';
    },
  ): Promise<string>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[ScreenshotOptions](./puppeteer.screenshotoptions.md)&gt; &amp; &#123; encoding: 'base64'; &#125;

</td><td>

Configures screenshot behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string&gt;

## Remarks

While a screenshot is being taken in a [BrowserContext](./puppeteer.browsercontext.md), the following methods will automatically wait for the screenshot to finish to prevent interference with the screenshot process: [BrowserContext.newPage()](./puppeteer.browsercontext.newpage.md), [Browser.newPage()](./puppeteer.browser.newpage.md), [Page.close()](./puppeteer.page.close.md).

Calling [Page.bringToFront()](./puppeteer.page.bringtofront.md) will not wait for existing screenshot operations.

<h2 id="screenshot-1">screenshot(): Promise&lt;Uint8Array&gt;</h2>

### Signature

```typescript
class Page {
  screenshot(options?: Readonly<ScreenshotOptions>): Promise<Uint8Array>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

Readonly&lt;[ScreenshotOptions](./puppeteer.screenshotoptions.md)&gt;

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Uint8Array&gt;

    ---
sidebar_label: Page.select
---

# Page.select() method

Triggers a `change` and `input` event once all the provided options have been selected. If there's no `<select>` element matching `selector`, the method throws an error.

### Signature

```typescript
class Page {
  select(selector: string, ...values: string[]): Promise<string[]>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

values

</td><td>

string\[\]

</td><td>

Values of options to select. If the `<select>` has the `multiple` attribute, all values are considered, otherwise only the first one is taken into account.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string\[\]&gt;

## Remarks

Shortcut for [page.mainFrame().select()](./puppeteer.frame.select.md)

## Example

```ts
page.select('select#colors', 'blue'); // single selection
page.select('select#colors', 'red', 'green', 'blue'); // multiple selections
```

    ---
sidebar_label: Page.setBypassCSP
---

# Page.setBypassCSP() method

Toggles bypassing page's Content-Security-Policy.

### Signature

```typescript
class Page {
  abstract setBypassCSP(enabled: boolean): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

enabled

</td><td>

boolean

</td><td>

sets bypassing of page's Content-Security-Policy.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

NOTE: CSP bypassing happens at the moment of CSP initialization rather than evaluation. Usually, this means that `page.setBypassCSP` should be called before navigating to the domain.

    ---
sidebar_label: Page.setBypassServiceWorker
---

# Page.setBypassServiceWorker() method

Toggles ignoring of service worker for each request.

### Signature

```typescript
class Page {
  abstract setBypassServiceWorker(bypass: boolean): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

bypass

</td><td>

boolean

</td><td>

Whether to bypass service worker and load from network.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.setCacheEnabled
---

# Page.setCacheEnabled() method

Toggles ignoring cache for each request based on the enabled state. By default, caching is enabled.

### Signature

```typescript
class Page {
  abstract setCacheEnabled(enabled?: boolean): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

enabled

</td><td>

boolean

</td><td>

_(Optional)_ sets the `enabled` state of cache

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

#### Default value:

`true`

    ---
sidebar_label: Page.setContent
---

# Page.setContent() method

Set the content of the page.

### Signature

```typescript
class Page {
  setContent(html: string, options?: WaitForOptions): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

html

</td><td>

string

</td><td>

HTML markup to assign to the page.

</td></tr>
<tr><td>

options

</td><td>

[WaitForOptions](./puppeteer.waitforoptions.md)

</td><td>

_(Optional)_ Parameters that has some properties.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.setCookie
---

# Page.setCookie() method

> Warning: This API is now obsolete.
>
> Page-level cookie API is deprecated. Use [Browser.setCookie()](./puppeteer.browser.setcookie.md) or [BrowserContext.setCookie()](./puppeteer.browsercontext.setcookie.md) instead.

### Signature

```typescript
class Page {
  abstract setCookie(...cookies: CookieParam[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

cookies

</td><td>

[CookieParam](./puppeteer.cookieparam.md)\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

```ts
await page.setCookie(cookieObject1, cookieObject2);
```

    ---
sidebar_label: Page.setDefaultNavigationTimeout
---

# Page.setDefaultNavigationTimeout() method

This setting will change the default maximum navigation time for the following methods and related shortcuts:

- [page.goBack(options)](./puppeteer.page.goback.md)

- [page.goForward(options)](./puppeteer.page.goforward.md)

- [page.goto(url,options)](./puppeteer.page.goto.md)

- [page.reload(options)](./puppeteer.page.reload.md)

- [page.setContent(html,options)](./puppeteer.page.setcontent.md)

- [page.waitForNavigation(options)](./puppeteer.page.waitfornavigation.md)

### Signature

```typescript
class Page {
  abstract setDefaultNavigationTimeout(timeout: number): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

timeout

</td><td>

number

</td><td>

Maximum navigation time in milliseconds.

</td></tr>
</tbody></table>

**Returns:**

void

    ---
sidebar_label: Page.setDefaultTimeout
---

# Page.setDefaultTimeout() method

### Signature

```typescript
class Page {
  abstract setDefaultTimeout(timeout: number): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

timeout

</td><td>

number

</td><td>

Maximum time in milliseconds.

</td></tr>
</tbody></table>

**Returns:**

void

    ---
sidebar_label: Page.setDragInterception
---

# Page.setDragInterception() method

> Warning: This API is now obsolete.
>
> We no longer support intercepting drag payloads. Use the new drag APIs found on [ElementHandle](./puppeteer.elementhandle.md) to drag (or just use the [Page.mouse](./puppeteer.page.md#mouse)).

### Signature

```typescript
class Page {
  abstract setDragInterception(enabled: boolean): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

enabled

</td><td>

boolean

</td><td>

Whether to enable drag interception.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.setExtraHTTPHeaders
---

# Page.setExtraHTTPHeaders() method

The extra HTTP headers will be sent with every request the page initiates.

:::tip

All HTTP header names are lowercased. (HTTP headers are case-insensitive, so this shouldn’t impact your server code.)

:::

:::note

page.setExtraHTTPHeaders does not guarantee the order of headers in the outgoing requests.

:::

### Signature

```typescript
class Page {
  abstract setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

headers

</td><td>

Record&lt;string, string&gt;

</td><td>

An object containing additional HTTP headers to be sent with every request. All header values must be strings.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.setGeolocation
---

# Page.setGeolocation() method

Sets the page's geolocation.

### Signature

```typescript
class Page {
  abstract setGeolocation(options: GeolocationOptions): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[GeolocationOptions](./puppeteer.geolocationoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Consider using [BrowserContext.overridePermissions()](./puppeteer.browsercontext.overridepermissions.md) to grant permissions for the page to read its geolocation.

## Example

```ts
await page.setGeolocation({latitude: 59.95, longitude: 30.31667});
```

    ---
sidebar_label: Page.setJavaScriptEnabled
---

# Page.setJavaScriptEnabled() method

### Signature

```typescript
class Page {
  abstract setJavaScriptEnabled(enabled: boolean): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

enabled

</td><td>

boolean

</td><td>

Whether or not to enable JavaScript on the page.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

NOTE: changing this value won't affect scripts that have already been run. It will take full effect on the next navigation.

    ---
sidebar_label: Page.setOfflineMode
---

# Page.setOfflineMode() method

Sets the network connection to offline.

It does not change the parameters used in [Page.emulateNetworkConditions()](./puppeteer.page.emulatenetworkconditions.md)

### Signature

```typescript
class Page {
  abstract setOfflineMode(enabled: boolean): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

enabled

</td><td>

boolean

</td><td>

When `true`, enables offline mode for the page.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Page.setRequestInterception
---

# Page.setRequestInterception() method

Activating request interception enables [HTTPRequest.abort()](./puppeteer.httprequest.abort.md), [HTTPRequest.continue()](./puppeteer.httprequest.continue.md) and [HTTPRequest.respond()](./puppeteer.httprequest.respond.md) methods. This provides the capability to modify network requests that are made by a page.

Once request interception is enabled, every request will stall unless it's continued, responded or aborted; or completed using the browser cache.

See the [Request interception guide](https://pptr.dev/guides/network-interception) for more details.

### Signature

```typescript
class Page {
  abstract setRequestInterception(value: boolean): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

value

</td><td>

boolean

</td><td>

Whether to enable request interception.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

An example of a naïve request interceptor that aborts all image requests:

```ts
import puppeteer from 'puppeteer';
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setRequestInterception(true);
  page.on('request', interceptedRequest => {
    if (
      interceptedRequest.url().endsWith('.png') ||
      interceptedRequest.url().endsWith('.jpg')
    )
      interceptedRequest.abort();
    else interceptedRequest.continue();
  });
  await page.goto('https://example.com');
  await browser.close();
})();
```

    ---
sidebar_label: Page.setUserAgent
---

# Page.setUserAgent() method

### Signature

```typescript
class Page {
  abstract setUserAgent(
    userAgent: string,
    userAgentMetadata?: Protocol.Emulation.UserAgentMetadata,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

userAgent

</td><td>

string

</td><td>

Specific user agent to use in this page

</td></tr>
<tr><td>

userAgentMetadata

</td><td>

Protocol.Emulation.UserAgentMetadata

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

Promise which resolves when the user agent is set.

    ---
sidebar_label: Page.setViewport
---

# Page.setViewport() method

`page.setViewport` will resize the page. A lot of websites don't expect phones to change size, so you should set the viewport before navigating to the page.

In the case of multiple pages in a single browser, each page can have its own viewport size. Setting the viewport to `null` resets the viewport to its default value.

### Signature

```typescript
class Page {
  abstract setViewport(viewport: Viewport | null): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

viewport

</td><td>

[Viewport](./puppeteer.viewport.md) \| null

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

NOTE: in certain cases, setting viewport will reload the page in order to set the isMobile or hasTouch properties.

## Example

```ts
const page = await browser.newPage();
await page.setViewport({
  width: 640,
  height: 480,
  deviceScaleFactor: 1,
});
await page.goto('https://example.com');
```

    ---
sidebar_label: Page.tap
---

# Page.tap() method

This method fetches an element with `selector`, scrolls it into view if needed, and then uses [Page.touchscreen](./puppeteer.page.md#touchscreen) to tap in the center of the element. If there's no element matching `selector`, the method throws an error.

### Signature

```typescript
class Page {
  tap(selector: string): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax). If there are multiple elements satisfying the selector, the first will be tapped.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Shortcut for [page.mainFrame().tap(selector)](./puppeteer.frame.tap.md).

    ---
sidebar_label: Page.target
---

# Page.target() method

> Warning: This API is now obsolete.
>
> Use [Page.createCDPSession()](./puppeteer.page.createcdpsession.md) directly.

A target this page was created from.

### Signature

```typescript
class Page {
  abstract target(): Target;
}
```

**Returns:**

[Target](./puppeteer.target.md)

    ---
sidebar_label: Page.title
---

# Page.title() method

The page's title

### Signature

```typescript
class Page {
  title(): Promise<string>;
}
```

**Returns:**

Promise&lt;string&gt;

## Remarks

Shortcut for [page.mainFrame().title()](./puppeteer.frame.title.md).

    ---
sidebar_label: Page.type
---

# Page.type() method

Sends a `keydown`, `keypress/input`, and `keyup` event for each character in the text.

To press a special key, like `Control` or `ArrowDown`, use [Keyboard.press()](./puppeteer.keyboard.press.md).

### Signature

```typescript
class Page {
  type(
    selector: string,
    text: string,
    options?: Readonly<KeyboardTypeOptions>,
  ): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

string

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

text

</td><td>

string

</td><td>

A text to type into a focused element.

</td></tr>
<tr><td>

options

</td><td>

Readonly&lt;[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)&gt;

</td><td>

_(Optional)_ have property `delay` which is the Time to wait between key presses in milliseconds. Defaults to `0`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Example

```ts
await page.type('#mytextarea', 'Hello');
// Types instantly
await page.type('#mytextarea', 'World', {delay: 100});
// Types slower, like a user
```

    ---
sidebar_label: Page.url
---

# Page.url() method

The page's URL.

### Signature

```typescript
class Page {
  url(): string;
}
```

**Returns:**

string

## Remarks

Shortcut for [page.mainFrame().url()](./puppeteer.frame.url.md).

    ---
sidebar_label: Page.viewport
---

# Page.viewport() method

Returns the current page viewport settings without checking the actual page viewport.

This is either the viewport set with the previous [Page.setViewport()](./puppeteer.page.setviewport.md) call or the default viewport set via [ConnectOptions.defaultViewport](./puppeteer.connectoptions.md#defaultviewport).

### Signature

```typescript
class Page {
  abstract viewport(): Viewport | null;
}
```

**Returns:**

[Viewport](./puppeteer.viewport.md) \| null

    ---
sidebar_label: Page.waitForDevicePrompt
---

# Page.waitForDevicePrompt() method

This method is typically coupled with an action that triggers a device request from an api such as WebBluetooth.

:::caution

This must be called before the device request is made. It will not return a currently active device prompt.

:::

### Signature

```typescript
class Page {
  abstract waitForDevicePrompt(
    options?: WaitTimeoutOptions,
  ): Promise<DeviceRequestPrompt>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[DeviceRequestPrompt](./puppeteer.devicerequestprompt.md)&gt;

## Example

```ts
const [devicePrompt] = Promise.all([
  page.waitForDevicePrompt(),
  page.click('#connect-bluetooth'),
]);
await devicePrompt.select(
  await devicePrompt.waitForDevice(({name}) => name.includes('My Device')),
);
```

    ---
sidebar_label: Page.waitForFileChooser
---

# Page.waitForFileChooser() method

This method is typically coupled with an action that triggers file choosing.

:::caution

This must be called before the file chooser is launched. It will not return a currently active file chooser.

:::

:::caution

Interception of file dialogs triggered via DOM APIs such as window.showOpenFilePicker is currently not supported.

:::

### Signature

```typescript
class Page {
  abstract waitForFileChooser(
    options?: WaitTimeoutOptions,
  ): Promise<FileChooser>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[FileChooser](./puppeteer.filechooser.md)&gt;

## Remarks

In the "headful" browser, this method results in the native file picker dialog `not showing up` for the user.

## Example

The following example clicks a button that issues a file chooser and then responds with `/tmp/myfile.pdf` as if a user has selected this file.

```ts
const [fileChooser] = await Promise.all([
  page.waitForFileChooser(),
  page.click('#upload-file-button'),
  // some button that triggers file selection
]);
await fileChooser.accept(['/tmp/myfile.pdf']);
```

    ---
sidebar_label: Page.waitForFrame
---

# Page.waitForFrame() method

Waits for a frame matching the given conditions to appear.

### Signature

```typescript
class Page {
  waitForFrame(
    urlOrPredicate: string | ((frame: Frame) => Awaitable<boolean>),
    options?: WaitTimeoutOptions,
  ): Promise<Frame>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

urlOrPredicate

</td><td>

string \| ((frame: [Frame](./puppeteer.frame.md)) =&gt; [Awaitable](./puppeteer.awaitable.md)&lt;boolean&gt;)

</td><td>

</td></tr>
<tr><td>

options

</td><td>

[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Frame](./puppeteer.frame.md)&gt;

## Example

```ts
const frame = await page.waitForFrame(async frame => {
  const frameElement = await frame.frameElement();
  if (!frameElement) {
    return false;
  }
  const name = await frameElement.evaluate(el => el.getAttribute('name'));
  return name === 'test';
});
```

    ---
sidebar_label: Page.waitForFunction
---

# Page.waitForFunction() method

Waits for the provided function, `pageFunction`, to return a truthy value when evaluated in the page's context.

### Signature

```typescript
class Page {
  waitForFunction<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(
    pageFunction: Func | string,
    options?: FrameWaitForFunctionOptions,
    ...args: Params
  ): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

pageFunction

</td><td>

Func \| string

</td><td>

Function to be evaluated in browser context until it returns a truthy value.

</td></tr>
<tr><td>

options

</td><td>

[FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md)

</td><td>

_(Optional)_ Options for configuring waiting behavior.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;&gt;

## Example 1

[Page.waitForFunction()](./puppeteer.page.waitforfunction.md) can be used to observe a viewport size change:

```ts
import puppeteer from 'puppeteer';
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  const watchDog = page.waitForFunction('window.innerWidth < 100');
  await page.setViewport({width: 50, height: 50});
  await watchDog;
  await browser.close();
})();
```

## Example 2

Arguments can be passed from Node.js to `pageFunction`:

```ts
const selector = '.foo';
await page.waitForFunction(
  selector => !!document.querySelector(selector),
  {},
  selector,
);
```

## Example 3

The provided `pageFunction` can be asynchronous:

```ts
const username = 'github-username';
await page.waitForFunction(
  async username => {
    const githubResponse = await fetch(
      `https://api.github.com/users/${username}`,
    );
    const githubUser = await githubResponse.json();
    // show the avatar
    const img = document.createElement('img');
    img.src = githubUser.avatar_url;
    // wait 3 seconds
    await new Promise((resolve, reject) => setTimeout(resolve, 3000));
    img.remove();
  },
  {},
  username,
);
```

    ---
sidebar_label: Page.waitForNavigation
---

# Page.waitForNavigation() method

Waits for the page to navigate to a new URL or to reload. It is useful when you run code that will indirectly cause the page to navigate.

### Signature

```typescript
class Page {
  waitForNavigation(options?: WaitForOptions): Promise<HTTPResponse | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitForOptions](./puppeteer.waitforoptions.md)

</td><td>

_(Optional)_ Navigation parameters which might have the following properties:

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md) \| null&gt;

A `Promise` which resolves to the main resource response.

- In case of multiple redirects, the navigation will resolve with the response of the last redirect. - In case of navigation to a different anchor or navigation due to History API usage, the navigation will resolve with `null`.

## Remarks

Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered a navigation.

## Example

```ts
const [response] = await Promise.all([
  page.waitForNavigation(), // The promise resolves after navigation has finished
  page.click('a.my-link'), // Clicking the link will indirectly cause a navigation
]);
```

    ---
sidebar_label: Page.waitForNetworkIdle
---

# Page.waitForNetworkIdle() method

Waits for the network to be idle.

### Signature

```typescript
class Page {
  waitForNetworkIdle(options?: WaitForNetworkIdleOptions): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[WaitForNetworkIdleOptions](./puppeteer.waitfornetworkidleoptions.md)

</td><td>

_(Optional)_ Options to configure waiting behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

A promise which resolves once the network is idle.

## Remarks

The function will always wait at least the set [IdleTime](./puppeteer.waitfornetworkidleoptions.md#idletime).

    ---
sidebar_label: Page.waitForRequest
---

# Page.waitForRequest() method

### Signature

```typescript
class Page {
  waitForRequest(
    urlOrPredicate: string | AwaitablePredicate<HTTPRequest>,
    options?: WaitTimeoutOptions,
  ): Promise<HTTPRequest>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

urlOrPredicate

</td><td>

string \| [AwaitablePredicate](./puppeteer.awaitablepredicate.md)&lt;[HTTPRequest](./puppeteer.httprequest.md)&gt;

</td><td>

A URL or predicate to wait for

</td></tr>
<tr><td>

options

</td><td>

[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)

</td><td>

_(Optional)_ Optional waiting parameters

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPRequest](./puppeteer.httprequest.md)&gt;

Promise which resolves to the matched request

## Remarks

Optional Waiting Parameters have:

- `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds, pass `0` to disable the timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method.

## Example

```ts
const firstRequest = await page.waitForRequest('https://example.com/resource');
const finalRequest = await page.waitForRequest(
  request => request.url() === 'https://example.com',
);
return finalRequest.response()?.ok();
```

    ---
sidebar_label: Page.waitForResponse
---

# Page.waitForResponse() method

### Signature

```typescript
class Page {
  waitForResponse(
    urlOrPredicate: string | AwaitablePredicate<HTTPResponse>,
    options?: WaitTimeoutOptions,
  ): Promise<HTTPResponse>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

urlOrPredicate

</td><td>

string \| [AwaitablePredicate](./puppeteer.awaitablepredicate.md)&lt;[HTTPResponse](./puppeteer.httpresponse.md)&gt;

</td><td>

A URL or predicate to wait for.

</td></tr>
<tr><td>

options

</td><td>

[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)

</td><td>

_(Optional)_ Optional waiting parameters

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HTTPResponse](./puppeteer.httpresponse.md)&gt;

Promise which resolves to the matched response.

## Remarks

Optional Parameter have:

- `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds, pass `0` to disable the timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method.

## Example

```ts
const firstResponse = await page.waitForResponse(
  'https://example.com/resource',
);
const finalResponse = await page.waitForResponse(
  response =>
    response.url() === 'https://example.com' && response.status() === 200,
);
const finalResponse = await page.waitForResponse(async response => {
  return (await response.text()).includes('<html>');
});
return finalResponse.ok();
```

    ---
sidebar_label: Page.waitForSelector
---

# Page.waitForSelector() method

Wait for the `selector` to appear in page. If at the moment of calling the method the `selector` already exists, the method will return immediately. If the `selector` doesn't appear after the `timeout` milliseconds of waiting, the function will throw.

### Signature

```typescript
class Page {
  waitForSelector<Selector extends string>(
    selector: Selector,
    options?: WaitForSelectorOptions,
  ): Promise<ElementHandle<NodeFor<Selector>> | null>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

selector

</td><td>

Selector

</td><td>

[selector](https://pptr.dev/guides/page-interactions#selectors) to query the page for. [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) can be passed as-is and a [Puppeteer-specific selector syntax](https://pptr.dev/guides/page-interactions#non-css-selectors) allows querying by [text](https://pptr.dev/guides/page-interactions#text-selectors--p-text), [a11y role and name](https://pptr.dev/guides/page-interactions#aria-selectors--p-aria), and [xpath](https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath) and [combining these queries across shadow roots](https://pptr.dev/guides/page-interactions#querying-elements-in-shadow-dom). Alternatively, you can specify the selector type using a [prefix](https://pptr.dev/guides/page-interactions#prefixed-selector-syntax).

</td></tr>
<tr><td>

options

</td><td>

[WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md)

</td><td>

_(Optional)_ Optional waiting parameters

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt; \| null&gt;

Promise which resolves when element specified by selector string is added to DOM. Resolves to `null` if waiting for hidden: `true` and selector is not found in DOM.

## Remarks

The optional Parameter in Arguments `options` are:

- `visible`: A boolean wait for element to be present in DOM and to be visible, i.e. to not have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`.

- `hidden`: Wait for element to not be found in the DOM or to be hidden, i.e. have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`.

- `timeout`: maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method.

## Example

This method works across navigations:

```ts
import puppeteer from 'puppeteer';
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  let currentURL;
  page
    .waitForSelector('img')
    .then(() => console.log('First URL with image: ' + currentURL));
  for (currentURL of [
    'https://example.com',
    'https://google.com',
    'https://bbc.com',
  ]) {
    await page.goto(currentURL);
  }
  await browser.close();
})();
```

    ---
sidebar_label: Page.workers
---

# Page.workers() method

All of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page.

### Signature

```typescript
class Page {
  abstract workers(): WebWorker[];
}
```

**Returns:**

[WebWorker](./puppeteer.webworker.md)\[\]

## Remarks

This does not contain ServiceWorkers

    ---
sidebar_label: PageEvent
---

# PageEvent enum

All the events that a page instance may emit.

### Signature

```typescript
export declare const enum PageEvent
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

Close

</td><td>

`"close"`

</td><td>

Emitted when the page closes.

</td></tr>
<tr><td>

Console

</td><td>

`"console"`

</td><td>

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.

</td></tr>
<tr><td>

Dialog

</td><td>

`"dialog"`

</td><td>

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).

</td></tr>
<tr><td>

DOMContentLoaded

</td><td>

`"domcontentloaded"`

</td><td>

Emitted when the JavaScript [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.

</td></tr>
<tr><td>

Error

</td><td>

`"error"`

</td><td>

Emitted when the page crashes. Will contain an `Error`.

</td></tr>
<tr><td>

FrameAttached

</td><td>

`"frameattached"`

</td><td>

Emitted when a frame is attached. Will contain a [Frame](./puppeteer.frame.md).

</td></tr>
<tr><td>

FrameDetached

</td><td>

`"framedetached"`

</td><td>

Emitted when a frame is detached. Will contain a [Frame](./puppeteer.frame.md).

</td></tr>
<tr><td>

FrameNavigated

</td><td>

`"framenavigated"`

</td><td>

Emitted when a frame is navigated to a new URL. Will contain a [Frame](./puppeteer.frame.md).

</td></tr>
<tr><td>

Load

</td><td>

`"load"`

</td><td>

Emitted when the JavaScript [load](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched.

</td></tr>
<tr><td>

Metrics

</td><td>

`"metrics"`

</td><td>

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.

</td></tr>
<tr><td>

PageError

</td><td>

`"pageerror"`

</td><td>

Emitted when an uncaught exception happens within the page. Contains an `Error`.

</td></tr>
<tr><td>

Popup

</td><td>

`"popup"`

</td><td>

Emitted when the page opens a new tab or window.

Contains a [Page](./puppeteer.page.md) corresponding to the popup window.

</td></tr>
<tr><td>

Request

</td><td>

`"request"`

</td><td>

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.

</td></tr>
<tr><td>

RequestFailed

</td><td>

`"requestfailed"`

</td><td>

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`.

</td></tr>
<tr><td>

RequestFinished

</td><td>

`"requestfinished"`

</td><td>

Emitted when a request finishes successfully. Contains a [HTTPRequest](./puppeteer.httprequest.md).

</td></tr>
<tr><td>

RequestServedFromCache

</td><td>

`"requestservedfromcache"`

</td><td>

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)

</td></tr>
<tr><td>

Response

</td><td>

`"response"`

</td><td>

Emitted when a response is received. Contains a [HTTPResponse](./puppeteer.httpresponse.md).

</td></tr>
<tr><td>

WorkerCreated

</td><td>

`"workercreated"`

</td><td>

Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the page.

</td></tr>
<tr><td>

WorkerDestroyed

</td><td>

`"workerdestroyed"`

</td><td>

Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is destroyed by the page.

</td></tr>
</tbody></table>

    ---
sidebar_label: PageEvents
---

# PageEvents interface

Denotes the objects received by callback functions for page events.

See [PageEvent](./puppeteer.pageevent.md) for more detail on the events and when they are emitted.

### Signature

```typescript
export interface PageEvents extends Record<EventType, unknown>
```

**Extends:** Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="close">close</span>

</td><td>

</td><td>

undefined

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="console">console</span>

</td><td>

</td><td>

[ConsoleMessage](./puppeteer.consolemessage.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="dialog">dialog</span>

</td><td>

</td><td>

[Dialog](./puppeteer.dialog.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="domcontentloaded">domcontentloaded</span>

</td><td>

</td><td>

undefined

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="error">error</span>

</td><td>

</td><td>

Error

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="frameattached">frameattached</span>

</td><td>

</td><td>

[Frame](./puppeteer.frame.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="framedetached">framedetached</span>

</td><td>

</td><td>

[Frame](./puppeteer.frame.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="framenavigated">framenavigated</span>

</td><td>

</td><td>

[Frame](./puppeteer.frame.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="load">load</span>

</td><td>

</td><td>

undefined

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="metrics">metrics</span>

</td><td>

</td><td>

&#123; title: string; metrics: [Metrics](./puppeteer.metrics.md); &#125;

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="pageerror">pageerror</span>

</td><td>

</td><td>

Error

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="popup">popup</span>

</td><td>

</td><td>

[Page](./puppeteer.page.md) \| null

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="request">request</span>

</td><td>

</td><td>

[HTTPRequest](./puppeteer.httprequest.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="requestfailed">requestfailed</span>

</td><td>

</td><td>

[HTTPRequest](./puppeteer.httprequest.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="requestfinished">requestfinished</span>

</td><td>

</td><td>

[HTTPRequest](./puppeteer.httprequest.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="requestservedfromcache">requestservedfromcache</span>

</td><td>

</td><td>

[HTTPRequest](./puppeteer.httprequest.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="response">response</span>

</td><td>

</td><td>

[HTTPResponse](./puppeteer.httpresponse.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="workercreated">workercreated</span>

</td><td>

</td><td>

[WebWorker](./puppeteer.webworker.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="workerdestroyed">workerdestroyed</span>

</td><td>

</td><td>

[WebWorker](./puppeteer.webworker.md)

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: PaperFormat
---

# PaperFormat type

All the valid paper format types when printing a PDF.

### Signature

```typescript
export type PaperFormat =
  | Uppercase<LowerCasePaperFormat>
  | Capitalize<LowerCasePaperFormat>
  | LowerCasePaperFormat;
```

**References:** [LowerCasePaperFormat](./puppeteer.lowercasepaperformat.md)

## Remarks

The sizes of each format are as follows:

- `Letter`: 8.5in x 11in / 21.59cm x 27.94cm

- `Legal`: 8.5in x 14in / 21.59cm x 35.56cm

- `Tabloid`: 11in x 17in / 27.94cm x 43.18cm

- `Ledger`: 17in x 11in / 43.18cm x 27.94cm

- `A0`: 33.1102in x 46.811in / 84.1cm x 118.9cm

- `A1`: 23.3858in x 33.1102in / 59.4cm x 84.1cm

- `A2`: 16.5354in x 23.3858in / 42cm x 59.4cm

- `A3`: 11.6929in x 16.5354in / 29.7cm x 42cm

- `A4`: 8.2677in x 11.6929in / 21cm x 29.7cm

- `A5`: 5.8268in x 8.2677in / 14.8cm x 21cm

- `A6`: 4.1339in x 5.8268in / 10.5cm x 14.8cm

    ---
sidebar_label: PDFMargin
---

# PDFMargin interface

### Signature

```typescript
export interface PDFMargin
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="bottom">bottom</span>

</td><td>

`optional`

</td><td>

string \| number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="left">left</span>

</td><td>

`optional`

</td><td>

string \| number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="right">right</span>

</td><td>

`optional`

</td><td>

string \| number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="top">top</span>

</td><td>

`optional`

</td><td>

string \| number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: PDFOptions
---

# PDFOptions interface

Valid options to configure PDF generation via [Page.pdf()](./puppeteer.page.pdf.md).

### Signature

```typescript
export interface PDFOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="displayheaderfooter">displayHeaderFooter</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to show the header and footer.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="footertemplate">footerTemplate</span>

</td><td>

`optional`

</td><td>

string

</td><td>

HTML template for the print footer. Has the same constraints and support for special classes as [PDFOptions.headerTemplate](./puppeteer.pdfoptions.md#headertemplate).

</td><td>

</td></tr>
<tr><td>

<span id="format">format</span>

</td><td>

`optional`

</td><td>

[PaperFormat](./puppeteer.paperformat.md)

</td><td>

**Remarks:**

If set, this takes priority over the `width` and `height` options.

</td><td>

`letter`.

</td></tr>
<tr><td>

<span id="headertemplate">headerTemplate</span>

</td><td>

`optional`

</td><td>

string

</td><td>

HTML template for the print header. Should be valid HTML with the following classes used to inject values into them:

- `date` formatted print date

- `title` document title

- `url` document location

- `pageNumber` current page number

- `totalPages` total pages in the document

</td><td>

</td></tr>
<tr><td>

<span id="height">height</span>

</td><td>

`optional`

</td><td>

string \| number

</td><td>

Sets the height of paper. You can pass in a number or a string with a unit.

</td><td>

</td></tr>
<tr><td>

<span id="landscape">landscape</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to print in landscape orientation.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="margin">margin</span>

</td><td>

`optional`

</td><td>

[PDFMargin](./puppeteer.pdfmargin.md)

</td><td>

Set the PDF margins.

</td><td>

`undefined` no margins are set.

</td></tr>
<tr><td>

<span id="omitbackground">omitBackground</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Hides default white background and allows generating pdfs with transparency.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="outline">outline</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

**_(Experimental)_** Generate document outline.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="pageranges">pageRanges</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Paper ranges to print, e.g. `1-5, 8, 11-13`.

</td><td>

The empty string, which means all pages are printed.

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

string

</td><td>

The path to save the file to.

**Remarks:**

If the path is relative, it's resolved relative to the current working directory.

</td><td>

`undefined`, which means the PDF will not be written to disk.

</td></tr>
<tr><td>

<span id="prefercsspagesize">preferCSSPageSize</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Give any CSS `@page` size declared in the page priority over what is declared in the `width` or `height` or `format` option.

</td><td>

`false`, which will scale the content to fit the paper size.

</td></tr>
<tr><td>

<span id="printbackground">printBackground</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Set to `true` to print background graphics.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="scale">scale</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Scales the rendering of the web page. Amount must be between `0.1` and `2`.

</td><td>

`1`

</td></tr>
<tr><td>

<span id="tagged">tagged</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

**_(Experimental)_** Generate tagged (accessible) PDF.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Timeout in milliseconds. Pass `0` to disable timeout.

The default value can be changed by using [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md)

</td><td>

`30_000`

</td></tr>
<tr><td>

<span id="waitforfonts">waitForFonts</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

If true, waits for `document.fonts.ready` to resolve. This might require activating the page using [Page.bringToFront()](./puppeteer.page.bringtofront.md) if the page is in the background.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="width">width</span>

</td><td>

`optional`

</td><td>

string \| number

</td><td>

Sets the width of paper. You can pass in a number or a string with a unit.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Permission
---

# Permission type

### Signature

```typescript
export type Permission =
  | 'accelerometer'
  | 'ambient-light-sensor'
  | 'background-sync'
  | 'camera'
  | 'clipboard-read'
  | 'clipboard-sanitized-write'
  | 'clipboard-write'
  | 'geolocation'
  | 'gyroscope'
  | 'idle-detection'
  | 'keyboard-lock'
  | 'magnetometer'
  | 'microphone'
  | 'midi-sysex'
  | 'midi'
  | 'notifications'
  | 'payment-handler'
  | 'persistent-storage'
  | 'pointer-lock';
```

    ---
sidebar_label: Point
---

# Point interface

### Signature

```typescript
export interface Point
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="x">x</span>

</td><td>

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="y">y</span>

</td><td>

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: PredefinedNetworkConditions
---

# PredefinedNetworkConditions variable

A list of pre-defined network conditions to be used with [Page.emulateNetworkConditions()](./puppeteer.page.emulatenetworkconditions.md).

### Signature

```typescript
PredefinedNetworkConditions: Readonly<{
  'Slow 3G': NetworkConditions;
  'Fast 3G': NetworkConditions;
  'Slow 4G': NetworkConditions;
  'Fast 4G': NetworkConditions;
}>;
```

## Example

```ts
import {PredefinedNetworkConditions} from 'puppeteer';
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.emulateNetworkConditions(PredefinedNetworkConditions['Slow 3G']);
  await page.goto('https://www.google.com');
  await page.emulateNetworkConditions(PredefinedNetworkConditions['Fast 3G']);
  await page.goto('https://www.google.com');
  await page.emulateNetworkConditions(PredefinedNetworkConditions['Slow 4G']); // alias to Fast 3G.
  await page.goto('https://www.google.com');
  await page.emulateNetworkConditions(PredefinedNetworkConditions['Fast 4G']);
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();
```

    ---
sidebar_label: Predicate
---

# Predicate type

### Signature

```typescript
export type Predicate<From, To extends From = From> =
  | ((value: From) => value is To)
  | ((value: From) => Awaitable<boolean>);
```

**References:** [Awaitable](./puppeteer.awaitable.md)

    ---
sidebar_label: ProtocolError
---

# ProtocolError class

ProtocolError is emitted whenever there is an error from the protocol.

### Signature

```typescript
export declare class ProtocolError extends PuppeteerError
```

**Extends:** [PuppeteerError](./puppeteer.puppeteererror.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="code">code</span>

</td><td>

`readonly`

</td><td>

number \| undefined

</td><td>

</td></tr>
<tr><td>

<span id="originalmessage">originalMessage</span>

</td><td>

`readonly`

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ProtocolLifeCycleEvent
---

# ProtocolLifeCycleEvent type

### Signature

```typescript
export type ProtocolLifeCycleEvent =
  | 'load'
  | 'DOMContentLoaded'
  | 'networkIdle'
  | 'networkAlmostIdle';
```

    ---
sidebar_label: ProtocolType
---

# ProtocolType type

### Signature

```typescript
export type ProtocolType = 'cdp' | 'webDriverBiDi';
```

    ---
sidebar_label: Puppeteer.clearCustomQueryHandlers
---

# Puppeteer.clearCustomQueryHandlers() method

Unregisters all custom query handlers.

### Signature

```typescript
class Puppeteer {
  static clearCustomQueryHandlers(): void;
}
```

**Returns:**

void

    ---
sidebar_label: Puppeteer.connect
---

# Puppeteer.connect() method

This method attaches Puppeteer to an existing browser instance.

### Signature

```typescript
class Puppeteer {
  connect(options: ConnectOptions): Promise<Browser>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[ConnectOptions](./puppeteer.connectoptions.md)

</td><td>

Set of configurable options to set on the browser.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Browser](./puppeteer.browser.md)&gt;

Promise which resolves to browser instance.

## Remarks

    ---
sidebar_label: Puppeteer.customQueryHandlerNames
---

# Puppeteer.customQueryHandlerNames() method

Gets the names of all custom query handlers.

### Signature

```typescript
class Puppeteer {
  static customQueryHandlerNames(): string[];
}
```

**Returns:**

string\[\]

    ---
sidebar_label: puppeteer
---

# puppeteer variable

### Signature

```typescript
puppeteer: PuppeteerCore.PuppeteerNode;
```

    ---
sidebar_label: Puppeteer.registerCustomQueryHandler
---

# Puppeteer.registerCustomQueryHandler() method

Registers a [custom query handler](./puppeteer.customqueryhandler.md).

### Signature

```typescript
class Puppeteer {
  static registerCustomQueryHandler(
    name: string,
    queryHandler: CustomQueryHandler,
  ): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

name

</td><td>

string

</td><td>

The name that the custom query handler will be registered under.

</td></tr>
<tr><td>

queryHandler

</td><td>

[CustomQueryHandler](./puppeteer.customqueryhandler.md)

</td><td>

The [custom query handler](./puppeteer.customqueryhandler.md) to register.

</td></tr>
</tbody></table>

**Returns:**

void

## Remarks

After registration, the handler can be used everywhere where a selector is expected by prepending the selection string with `<name>/`. The name is only allowed to consist of lower- and upper case latin letters.

## Example

```
import {Puppeteer}, puppeteer from 'puppeteer';

Puppeteer.registerCustomQueryHandler('text', { … });
const aHandle = await page.$('text/…');
```

    ---
sidebar_label: Puppeteer.unregisterCustomQueryHandler
---

# Puppeteer.unregisterCustomQueryHandler() method

Unregisters a custom query handler for a given name.

### Signature

```typescript
class Puppeteer {
  static unregisterCustomQueryHandler(name: string): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

name

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

void

    ---
sidebar_label: PuppeteerError
---

# PuppeteerError class

The base class for all Puppeteer-specific errors

### Signature

```typescript
export declare class PuppeteerError extends Error
```

**Extends:** Error

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `PuppeteerError` class.

    ---
sidebar_label: PuppeteerLifeCycleEvent
---

# PuppeteerLifeCycleEvent type

### Signature

```typescript
export type PuppeteerLifeCycleEvent =
  /**
   * Waits for the 'load' event.
   */
  | 'load'
  /**
   * Waits for the 'DOMContentLoaded' event.
   */
  | 'domcontentloaded'
  /**
   * Waits till there are no more than 0 network connections for at least `500`
   * ms.
   */
  | 'networkidle0'
  /**
   * Waits till there are no more than 2 network connections for at least `500`
   * ms.
   */
  | 'networkidle2';
```

    ---
sidebar_label: PuppeteerNode.connect
---

# PuppeteerNode.connect() method

This method attaches Puppeteer to an existing browser instance.

### Signature

```typescript
class PuppeteerNode {
  connect(options: ConnectOptions): Promise<Browser>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[ConnectOptions](./puppeteer.connectoptions.md)

</td><td>

Set of configurable options to set on the browser.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Browser](./puppeteer.browser.md)&gt;

Promise which resolves to browser instance.

    ---
sidebar_label: PuppeteerNode.defaultArgs
---

# PuppeteerNode.defaultArgs() method

### Signature

```typescript
class PuppeteerNode {
  defaultArgs(options?: LaunchOptions): string[];
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[LaunchOptions](./puppeteer.launchoptions.md)

</td><td>

_(Optional)_ Set of configurable options to set on the browser.

</td></tr>
</tbody></table>

**Returns:**

string\[\]

The default arguments that the browser will be launched with.

    ---
sidebar_label: PuppeteerNode.executablePath
---

# PuppeteerNode.executablePath() method

<h2 id="executablePath">executablePath(): string</h2>

The default executable path for a given ChromeReleaseChannel.

### Signature

```typescript
class PuppeteerNode {
  executablePath(channel: ChromeReleaseChannel): string;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

channel

</td><td>

[ChromeReleaseChannel](./puppeteer.chromereleasechannel.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

string

<h2 id="executablePath-1">executablePath(): string</h2>

The default executable path given LaunchOptions.

### Signature

```typescript
class PuppeteerNode {
  executablePath(options: LaunchOptions): string;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[LaunchOptions](./puppeteer.launchoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

string

<h2 id="executablePath-2">executablePath(): string</h2>

The default executable path.

### Signature

```typescript
class PuppeteerNode {
  executablePath(): string;
}
```

**Returns:**

string

    ---
sidebar_label: PuppeteerNode.launch
---

# PuppeteerNode.launch() method

Launches a browser instance with given arguments and options when specified.

When using with `puppeteer-core`, [options.executablePath](./puppeteer.launchoptions.md#executablepath) or [options.channel](./puppeteer.launchoptions.md#channel) must be provided.

### Signature

```typescript
class PuppeteerNode {
  launch(options?: LaunchOptions): Promise<Browser>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[LaunchOptions](./puppeteer.launchoptions.md)

</td><td>

_(Optional)_ Options to configure launching behavior.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[Browser](./puppeteer.browser.md)&gt;

## Remarks

Puppeteer can also be used to control the Chrome browser, but it works best with the version of Chrome for Testing downloaded by default. There is no guarantee it will work with any other version. If Google Chrome (rather than Chrome for Testing) is preferred, a [Chrome Canary](https://www.google.com/chrome/browser/canary.html) or [Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested. See [this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [This article](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users. See [this doc](https://developer.chrome.com/blog/chrome-for-testing/) for the description of Chrome for Testing.

## Example

You can use [options.ignoreDefaultArgs](./puppeteer.launchoptions.md#ignoredefaultargs) to filter out `--mute-audio` from default arguments:

```ts
const browser = await puppeteer.launch({
  ignoreDefaultArgs: ['--mute-audio'],
});
```

    ---
sidebar_label: PuppeteerNode
---

# PuppeteerNode class

Extends the main [Puppeteer](./puppeteer.puppeteer.md) class with Node specific behaviour for fetching and downloading browsers.

If you're using Puppeteer in a Node environment, this is the class you'll get when you run `require('puppeteer')` (or the equivalent ES `import`).

### Signature

```typescript
export declare class PuppeteerNode extends Puppeteer
```

**Extends:** [Puppeteer](./puppeteer.puppeteer.md)

## Remarks

The most common method to use is [launch](./puppeteer.puppeteernode.launch.md), which is used to launch and connect to a new browser instance.

See [the main Puppeteer class](./puppeteer.puppeteer.md) for methods common to all environments, such as [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `PuppeteerNode` class.

## Example

The following is a typical example of using Puppeteer to drive automation:

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();
```

Once you have created a `page` you have access to a large API to interact with the page, navigate, or find certain elements in that page. The [\`page\` documentation](./puppeteer.page.md) lists all the available methods.

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="defaultbrowser">defaultBrowser</span>

</td><td>

`readonly`

</td><td>

[SupportedBrowser](./puppeteer.supportedbrowser.md)

</td><td>

The name of the browser that will be launched by default. For `puppeteer`, this is influenced by your configuration. Otherwise, it's `chrome`.

</td></tr>
<tr><td>

<span id="lastlaunchedbrowser">lastLaunchedBrowser</span>

</td><td>

`readonly`

</td><td>

[SupportedBrowser](./puppeteer.supportedbrowser.md)

</td><td>

The name of the browser that was last launched.

</td></tr>
<tr><td>

<span id="product">product</span>

</td><td>

`readonly, deprecated`

</td><td>

string

</td><td>

**Deprecated:**

Do not use as this field as it does not take into account multiple browsers of different types. Use [defaultBrowser](./puppeteer.puppeteernode.md#defaultbrowser) or [lastLaunchedBrowser](./puppeteer.puppeteernode.md#lastlaunchedbrowser).

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="connect">[connect(options)](./puppeteer.puppeteernode.connect.md)</span>

</td><td>

</td><td>

This method attaches Puppeteer to an existing browser instance.

</td></tr>
<tr><td>

<span id="defaultargs">[defaultArgs(options)](./puppeteer.puppeteernode.defaultargs.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="executablepath">[executablePath(channel)](./puppeteer.puppeteernode.executablepath.md)</span>

</td><td>

</td><td>

The default executable path for a given ChromeReleaseChannel.

</td></tr>
<tr><td>

<span id="executablepath">[executablePath(options)](./puppeteer.puppeteernode.executablepath.md)</span>

</td><td>

</td><td>

The default executable path given LaunchOptions.

</td></tr>
<tr><td>

<span id="executablepath">[executablePath()](./puppeteer.puppeteernode.executablepath.md)</span>

</td><td>

</td><td>

The default executable path.

</td></tr>
<tr><td>

<span id="launch">[launch(options)](./puppeteer.puppeteernode.launch.md)</span>

</td><td>

</td><td>

Launches a browser instance with given arguments and options when specified.

When using with `puppeteer-core`, [options.executablePath](./puppeteer.launchoptions.md#executablepath) or [options.channel](./puppeteer.launchoptions.md#channel) must be provided.

**Remarks:**

Puppeteer can also be used to control the Chrome browser, but it works best with the version of Chrome for Testing downloaded by default. There is no guarantee it will work with any other version. If Google Chrome (rather than Chrome for Testing) is preferred, a [Chrome Canary](https://www.google.com/chrome/browser/canary.html) or [Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested. See [this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [This article](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users. See [this doc](https://developer.chrome.com/blog/chrome-for-testing/) for the description of Chrome for Testing.

</td></tr>
<tr><td>

<span id="trimcache">[trimCache()](./puppeteer.puppeteernode.trimcache.md)</span>

</td><td>

</td><td>

Removes all non-current Firefox and Chrome binaries in the cache directory identified by the provided Puppeteer configuration. The current browser version is determined by resolving PUPPETEER_REVISIONS from Puppeteer unless `configuration.browserRevision` is provided.

**Remarks:**

Note that the method does not check if any other Puppeteer versions installed on the host that use the same cache directory require the non-current binaries.

</td></tr>
</tbody></table>

    ---
sidebar_label: PuppeteerNode.trimCache
---

# PuppeteerNode.trimCache() method

Removes all non-current Firefox and Chrome binaries in the cache directory identified by the provided Puppeteer configuration. The current browser version is determined by resolving PUPPETEER_REVISIONS from Puppeteer unless `configuration.browserRevision` is provided.

### Signature

```typescript
class PuppeteerNode {
  trimCache(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

## Remarks

Note that the method does not check if any other Puppeteer versions installed on the host that use the same cache directory require the non-current binaries.

    ---
sidebar_label: Quad
---

# Quad type

### Signature

```typescript
export type Quad = [Point, Point, Point, Point];
```

**References:** [Point](./puppeteer.point.md)

    ---
sidebar_label: QueryOptions
---

# QueryOptions interface

### Signature

```typescript
export interface QueryOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="isolate">isolate</span>

</td><td>

</td><td>

boolean

</td><td>

Whether to run the query in isolation. When returning many elements from [Page.$$()](./puppeteer.page.__.md) or similar methods, it might be useful to turn off the isolation to improve performance. By default, the querying code will be executed in a separate sandbox realm.

</td><td>

`true`

</td></tr>
</tbody></table>

    ---
sidebar_label: RemoteAddress
---

# RemoteAddress interface

### Signature

```typescript
export interface RemoteAddress
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="ip">ip</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="port">port</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ResourceType
---

# ResourceType type

Resource types for HTTPRequests as perceived by the rendering engine.

### Signature

```typescript
export type ResourceType = Lowercase<Protocol.Network.ResourceType>;
```

    ---
sidebar_label: ResponseForRequest
---

# ResponseForRequest interface

Required response data to fulfill a request with.

### Signature

```typescript
export interface ResponseForRequest
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="body">body</span>

</td><td>

</td><td>

string \| Uint8Array

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="contenttype">contentType</span>

</td><td>

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="headers">headers</span>

</td><td>

</td><td>

Record&lt;string, string \| string\[\] \| unknown&gt;

</td><td>

Optional response headers.

The record values will be converted to string following: Arrays' values will be mapped to String (Used when you need multiple headers with the same name). Non-arrays will be converted to String.

</td><td>

</td></tr>
<tr><td>

<span id="status">status</span>

</td><td>

</td><td>

number

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: ScreencastOptions
---

# ScreencastOptions interface

### Signature

```typescript
export interface ScreencastOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="colors">colors</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specifies the maximum number of [palette](https://ffmpeg.org/ffmpeg-filters.html#palettegen) colors to quantize, with GIF limited to `256`. Restrict the palette to only necessary colors to reduce output file size.

</td><td>

`256`

</td></tr>
<tr><td>

<span id="crop">crop</span>

</td><td>

`optional`

</td><td>

[BoundingBox](./puppeteer.boundingbox.md)

</td><td>

Specifies the region of the viewport to crop.

</td><td>

</td></tr>
<tr><td>

<span id="delay">delay</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specifies the delay between iterations of a loop, in ms. `-1` is a special value to re-use the previous delay.

</td><td>

`-1`

</td></tr>
<tr><td>

<span id="ffmpegpath">ffmpegPath</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Path to the [ffmpeg](https://ffmpeg.org/).

Required if `ffmpeg` is not in your PATH.

</td><td>

`'ffmpeg'`

</td></tr>
<tr><td>

<span id="format">format</span>

</td><td>

`optional`

</td><td>

[VideoFormat](./puppeteer.videoformat.md)

</td><td>

Specifies the output file format.

</td><td>

`'webm'`

</td></tr>
<tr><td>

<span id="fps">fps</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specifies the frame rate in frames per second.

</td><td>

`30` (`20` for GIF)

</td></tr>
<tr><td>

<span id="loop">loop</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specifies the number of times to loop playback, from `0` to `Infinity`. A value of `0` or `undefined` will disable looping.

</td><td>

`undefined`

</td></tr>
<tr><td>

<span id="overwrite">overwrite</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Specifies whether to overwrite output file, or exit immediately if it already exists.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

\`$&#123;string&#125;.$&#123;[VideoFormat](./puppeteer.videoformat.md)&#125;\`

</td><td>

File path to save the screencast to.

</td><td>

</td></tr>
<tr><td>

<span id="quality">quality</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specifies the recording [quality](https://trac.ffmpeg.org/wiki/Encode/VP9#constantq) Constant Rate Factor between `0`–`63`. Lower values mean better quality.

</td><td>

`30`

</td></tr>
<tr><td>

<span id="scale">scale</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Scales the output video.

For example, `0.5` will shrink the width and height of the output video by half. `2` will double the width and height of the output video.

</td><td>

`1`

</td></tr>
<tr><td>

<span id="speed">speed</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specifies the speed to record at.

For example, `0.5` will slowdown the output video by 50%. `2` will double the speed of the output video.

</td><td>

`1`

</td></tr>
</tbody></table>

    ---
sidebar_label: ScreenRecorder
---

# ScreenRecorder class

### Signature

```typescript
export declare class ScreenRecorder extends PassThrough
```

**Extends:** PassThrough

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ScreenRecorder` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="stop">[stop()](./puppeteer.screenrecorder.stop.md)</span>

</td><td>

</td><td>

Stops the recorder.

</td></tr>
</tbody></table>

    ---
sidebar_label: ScreenRecorder.stop
---

# ScreenRecorder.stop() method

Stops the recorder.

### Signature

```typescript
class ScreenRecorder {
  stop(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: ScreenshotClip
---

# ScreenshotClip interface

### Signature

```typescript
export interface ScreenshotClip extends BoundingBox
```

**Extends:** [BoundingBox](./puppeteer.boundingbox.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="scale">scale</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

`1`

</td></tr>
</tbody></table>

    ---
sidebar_label: ScreenshotOptions
---

# ScreenshotOptions interface

### Signature

```typescript
export interface ScreenshotOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="capturebeyondviewport">captureBeyondViewport</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Capture the screenshot beyond the viewport.

</td><td>

`false` if there is no `clip`. `true` otherwise.

</td></tr>
<tr><td>

<span id="clip">clip</span>

</td><td>

`optional`

</td><td>

[ScreenshotClip](./puppeteer.screenshotclip.md)

</td><td>

Specifies the region of the page/element to clip.

</td><td>

</td></tr>
<tr><td>

<span id="encoding">encoding</span>

</td><td>

`optional`

</td><td>

'base64' \| 'binary'

</td><td>

Encoding of the image.

</td><td>

`'binary'`

</td></tr>
<tr><td>

<span id="fromsurface">fromSurface</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Capture the screenshot from the surface, rather than the view.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="fullpage">fullPage</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

When `true`, takes a screenshot of the full page.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="omitbackground">omitBackground</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Hides default white background and allows capturing screenshots with transparency.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="optimizeforspeed">optimizeForSpeed</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

`false`

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

\`$&#123;string&#125;.$&#123;[ImageFormat](./puppeteer.imageformat.md)&#125;\`

</td><td>

The file path to save the image to. The screenshot type will be inferred from file extension. If path is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.

</td><td>

</td></tr>
<tr><td>

<span id="quality">quality</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Quality of the image, between 0-100. Not applicable to `png` images.

</td><td>

</td></tr>
<tr><td>

<span id="type">type</span>

</td><td>

`optional`

</td><td>

[ImageFormat](./puppeteer.imageformat.md)

</td><td>

</td><td>

`'png'`

</td></tr>
</tbody></table>

    ---
sidebar_label: SecurityDetails.issuer
---

# SecurityDetails.issuer() method

The name of the issuer of the certificate.

### Signature

```typescript
class SecurityDetails {
  issuer(): string;
}
```

**Returns:**

string

    ---
sidebar_label: SecurityDetails
---

# SecurityDetails class

The SecurityDetails class represents the security details of a response that was received over a secure connection.

### Signature

```typescript
export declare class SecurityDetails
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `SecurityDetails` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="issuer">[issuer()](./puppeteer.securitydetails.issuer.md)</span>

</td><td>

</td><td>

The name of the issuer of the certificate.

</td></tr>
<tr><td>

<span id="protocol">[protocol()](./puppeteer.securitydetails.protocol.md)</span>

</td><td>

</td><td>

The security protocol being used, e.g. "TLS 1.2".

</td></tr>
<tr><td>

<span id="subjectalternativenames">[subjectAlternativeNames()](./puppeteer.securitydetails.subjectalternativenames.md)</span>

</td><td>

</td><td>

The list of [subject alternative names (SANs)](https://en.wikipedia.org/wiki/Subject_Alternative_Name) of the certificate.

</td></tr>
<tr><td>

<span id="subjectname">[subjectName()](./puppeteer.securitydetails.subjectname.md)</span>

</td><td>

</td><td>

The name of the subject to which the certificate was issued.

</td></tr>
<tr><td>

<span id="validfrom">[validFrom()](./puppeteer.securitydetails.validfrom.md)</span>

</td><td>

</td><td>

[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the start of the certificate's validity.

</td></tr>
<tr><td>

<span id="validto">[validTo()](./puppeteer.securitydetails.validto.md)</span>

</td><td>

</td><td>

[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the end of the certificate's validity.

</td></tr>
</tbody></table>

    ---
sidebar_label: SecurityDetails.protocol
---

# SecurityDetails.protocol() method

The security protocol being used, e.g. "TLS 1.2".

### Signature

```typescript
class SecurityDetails {
  protocol(): string;
}
```

**Returns:**

string

    ---
sidebar_label: SecurityDetails.subjectAlternativeNames
---

# SecurityDetails.subjectAlternativeNames() method

The list of [subject alternative names (SANs)](https://en.wikipedia.org/wiki/Subject_Alternative_Name) of the certificate.

### Signature

```typescript
class SecurityDetails {
  subjectAlternativeNames(): string[];
}
```

**Returns:**

string\[\]

    ---
sidebar_label: SecurityDetails.subjectName
---

# SecurityDetails.subjectName() method

The name of the subject to which the certificate was issued.

### Signature

```typescript
class SecurityDetails {
  subjectName(): string;
}
```

**Returns:**

string

    ---
sidebar_label: SecurityDetails.validFrom
---

# SecurityDetails.validFrom() method

[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the start of the certificate's validity.

### Signature

```typescript
class SecurityDetails {
  validFrom(): number;
}
```

**Returns:**

number

    ---
sidebar_label: SecurityDetails.validTo
---

# SecurityDetails.validTo() method

[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the end of the certificate's validity.

### Signature

```typescript
class SecurityDetails {
  validTo(): number;
}
```

**Returns:**

number

    ---
sidebar_label: SerializedAXNode.elementHandle
---

# SerializedAXNode.elementHandle() method

Get an ElementHandle for this AXNode if available.

If the underlying DOM element has been disposed, the method might return an error.

### Signature

```typescript
interface SerializedAXNode {
  elementHandle(): Promise<ElementHandle | null>;
}
```

**Returns:**

Promise&lt;[ElementHandle](./puppeteer.elementhandle.md) \| null&gt;

    ---
sidebar_label: SerializedAXNode
---

# SerializedAXNode interface

Represents a Node and the properties of it that are relevant to Accessibility.

### Signature

```typescript
export interface SerializedAXNode
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="autocomplete">autocomplete</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="checked">checked</span>

</td><td>

`optional`

</td><td>

boolean \| 'mixed'

</td><td>

Whether the checkbox is checked, or in a [mixed state](https://www.w3.org/TR/wai-aria-practices/examples/checkbox/checkbox-2/checkbox-2.html).

</td><td>

</td></tr>
<tr><td>

<span id="children">children</span>

</td><td>

`optional`

</td><td>

[SerializedAXNode](./puppeteer.serializedaxnode.md)\[\]

</td><td>

Children of this node, if there are any.

</td><td>

</td></tr>
<tr><td>

<span id="description">description</span>

</td><td>

`optional`

</td><td>

string

</td><td>

An additional human readable description of the node.

</td><td>

</td></tr>
<tr><td>

<span id="disabled">disabled</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="expanded">expanded</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="focused">focused</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="haspopup">haspopup</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="invalid">invalid</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Whether and in what way this node's value is invalid.

</td><td>

</td></tr>
<tr><td>

<span id="keyshortcuts">keyshortcuts</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Any keyboard shortcuts associated with this node.

</td><td>

</td></tr>
<tr><td>

<span id="level">level</span>

</td><td>

`optional`

</td><td>

number

</td><td>

The level of a heading.

</td><td>

</td></tr>
<tr><td>

<span id="modal">modal</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="multiline">multiline</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="multiselectable">multiselectable</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether more than one child can be selected.

</td><td>

</td></tr>
<tr><td>

<span id="name">name</span>

</td><td>

`optional`

</td><td>

string

</td><td>

A human readable name for the node.

</td><td>

</td></tr>
<tr><td>

<span id="orientation">orientation</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="pressed">pressed</span>

</td><td>

`optional`

</td><td>

boolean \| 'mixed'

</td><td>

Whether the node is checked or in a mixed state.

</td><td>

</td></tr>
<tr><td>

<span id="readonly">readonly</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="required">required</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="role">role</span>

</td><td>

</td><td>

string

</td><td>

The [role](https://www.w3.org/TR/wai-aria/#usage_intro) of the node.

</td><td>

</td></tr>
<tr><td>

<span id="roledescription">roledescription</span>

</td><td>

`optional`

</td><td>

string

</td><td>

A human readable alternative to the role.

</td><td>

</td></tr>
<tr><td>

<span id="selected">selected</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="value">value</span>

</td><td>

`optional`

</td><td>

string \| number

</td><td>

The current value of the node.

</td><td>

</td></tr>
<tr><td>

<span id="valuemax">valuemax</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="valuemin">valuemin</span>

</td><td>

`optional`

</td><td>

number

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="valuetext">valuetext</span>

</td><td>

`optional`

</td><td>

string

</td><td>

A description of the current value.

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="elementhandle">[elementHandle()](./puppeteer.serializedaxnode.elementhandle.md)</span>

</td><td>

Get an ElementHandle for this AXNode if available.

If the underlying DOM element has been disposed, the method might return an error.

</td></tr>
</tbody></table>

    ---
sidebar_label: SnapshotOptions
---

# SnapshotOptions interface

### Signature

```typescript
export interface SnapshotOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="includeiframes">includeIframes</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

If true, gets accessibility trees for each of the iframes in the frame subtree.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="interestingonly">interestingOnly</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Prune uninteresting nodes from the tree.

</td><td>

`true`

</td></tr>
<tr><td>

<span id="root">root</span>

</td><td>

`optional`

</td><td>

[ElementHandle](./puppeteer.elementhandle.md)&lt;Node&gt;

</td><td>

Root node to get the accessibility tree for

</td><td>

The root node of the entire page.

</td></tr>
</tbody></table>

    ---
sidebar_label: SupportedBrowser
---

# SupportedBrowser type

Browsers supported by Puppeteer.

### Signature

```typescript
export type SupportedBrowser = 'chrome' | 'firefox';
```

    ---
sidebar_label: SupportedWebDriverCapabilities
---

# SupportedWebDriverCapabilities interface

WebDriver BiDi capabilities that are not set by Puppeteer itself.

### Signature

```typescript
export interface SupportedWebDriverCapabilities
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="alwaysmatch">alwaysMatch</span>

</td><td>

`optional`

</td><td>

[SupportedWebDriverCapability](./puppeteer.supportedwebdrivercapability.md)

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="firstmatch">firstMatch</span>

</td><td>

`optional`

</td><td>

[SupportedWebDriverCapability](./puppeteer.supportedwebdrivercapability.md)\[\]

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: SupportedWebDriverCapability
---

# SupportedWebDriverCapability type

### Signature

```typescript
export type SupportedWebDriverCapability = Exclude<
  Session.CapabilityRequest,
  'unhandledPromptBehavior' | 'acceptInsecureCerts'
>;
```

    ---
sidebar_label: Target.asPage
---

# Target.asPage() method

Forcefully creates a page for a target of any type. It is useful if you want to handle a CDP target of type `other` as a page. If you deal with a regular page target, use [Target.page()](./puppeteer.target.page.md).

### Signature

```typescript
class Target {
  abstract asPage(): Promise<Page>;
}
```

**Returns:**

Promise&lt;[Page](./puppeteer.page.md)&gt;

    ---
sidebar_label: Target.browser
---

# Target.browser() method

Get the browser the target belongs to.

### Signature

```typescript
class Target {
  abstract browser(): Browser;
}
```

**Returns:**

[Browser](./puppeteer.browser.md)

    ---
sidebar_label: Target.browserContext
---

# Target.browserContext() method

Get the browser context the target belongs to.

### Signature

```typescript
class Target {
  abstract browserContext(): BrowserContext;
}
```

**Returns:**

[BrowserContext](./puppeteer.browsercontext.md)

    ---
sidebar_label: Target.createCDPSession
---

# Target.createCDPSession() method

Creates a Chrome Devtools Protocol session attached to the target.

### Signature

```typescript
class Target {
  abstract createCDPSession(): Promise<CDPSession>;
}
```

**Returns:**

Promise&lt;[CDPSession](./puppeteer.cdpsession.md)&gt;

    ---
sidebar_label: Target
---

# Target class

Target represents a [CDP target](https://chromedevtools.github.io/devtools-protocol/tot/Target/). In CDP a target is something that can be debugged such a frame, a page or a worker.

### Signature

```typescript
export declare abstract class Target
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Target` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="aspage">[asPage()](./puppeteer.target.aspage.md)</span>

</td><td>

</td><td>

Forcefully creates a page for a target of any type. It is useful if you want to handle a CDP target of type `other` as a page. If you deal with a regular page target, use [Target.page()](./puppeteer.target.page.md).

</td></tr>
<tr><td>

<span id="browser">[browser()](./puppeteer.target.browser.md)</span>

</td><td>

</td><td>

Get the browser the target belongs to.

</td></tr>
<tr><td>

<span id="browsercontext">[browserContext()](./puppeteer.target.browsercontext.md)</span>

</td><td>

</td><td>

Get the browser context the target belongs to.

</td></tr>
<tr><td>

<span id="createcdpsession">[createCDPSession()](./puppeteer.target.createcdpsession.md)</span>

</td><td>

</td><td>

Creates a Chrome Devtools Protocol session attached to the target.

</td></tr>
<tr><td>

<span id="opener">[opener()](./puppeteer.target.opener.md)</span>

</td><td>

</td><td>

Get the target that opened this target. Top-level targets return `null`.

</td></tr>
<tr><td>

<span id="page">[page()](./puppeteer.target.page.md)</span>

</td><td>

</td><td>

If the target is not of type `"page"`, `"webview"` or `"background_page"`, returns `null`.

</td></tr>
<tr><td>

<span id="type">[type()](./puppeteer.target.type.md)</span>

</td><td>

</td><td>

Identifies what kind of target this is.

**Remarks:**

See [docs](https://developer.chrome.com/extensions/background_pages) for more info about background pages.

</td></tr>
<tr><td>

<span id="url">[url()](./puppeteer.target.url.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="worker">[worker()](./puppeteer.target.worker.md)</span>

</td><td>

</td><td>

If the target is not of type `"service_worker"` or `"shared_worker"`, returns `null`.

</td></tr>
</tbody></table>

    ---
sidebar_label: Target.opener
---

# Target.opener() method

Get the target that opened this target. Top-level targets return `null`.

### Signature

```typescript
class Target {
  abstract opener(): Target | undefined;
}
```

**Returns:**

[Target](./puppeteer.target.md) \| undefined

    ---
sidebar_label: Target.page
---

# Target.page() method

If the target is not of type `"page"`, `"webview"` or `"background_page"`, returns `null`.

### Signature

```typescript
class Target {
  page(): Promise<Page | null>;
}
```

**Returns:**

Promise&lt;[Page](./puppeteer.page.md) \| null&gt;

    ---
sidebar_label: Target.type
---

# Target.type() method

Identifies what kind of target this is.

### Signature

```typescript
class Target {
  abstract type(): TargetType;
}
```

**Returns:**

[TargetType](./puppeteer.targettype.md)

## Remarks

See [docs](https://developer.chrome.com/extensions/background_pages) for more info about background pages.

    ---
sidebar_label: Target.url
---

# Target.url() method

### Signature

```typescript
class Target {
  abstract url(): string;
}
```

**Returns:**

string

    ---
sidebar_label: Target.worker
---

# Target.worker() method

If the target is not of type `"service_worker"` or `"shared_worker"`, returns `null`.

### Signature

```typescript
class Target {
  worker(): Promise<WebWorker | null>;
}
```

**Returns:**

Promise&lt;[WebWorker](./puppeteer.webworker.md) \| null&gt;

    ---
sidebar_label: TargetFilterCallback
---

# TargetFilterCallback type

### Signature

```typescript
export type TargetFilterCallback = (target: Target) => boolean;
```

**References:** [Target](./puppeteer.target.md)

    ---
sidebar_label: TargetType
---

# TargetType enum

### Signature

```typescript
export declare enum TargetType
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

BACKGROUND_PAGE

</td><td>

`"background_page"`

</td><td>

</td></tr>
<tr><td>

BROWSER

</td><td>

`"browser"`

</td><td>

</td></tr>
<tr><td>

OTHER

</td><td>

`"other"`

</td><td>

</td></tr>
<tr><td>

PAGE

</td><td>

`"page"`

</td><td>

</td></tr>
<tr><td>

SERVICE_WORKER

</td><td>

`"service_worker"`

</td><td>

</td></tr>
<tr><td>

SHARED_WORKER

</td><td>

`"shared_worker"`

</td><td>

</td></tr>
<tr><td>

WEBVIEW

</td><td>

`"webview"`

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: TimeoutError
---

# TimeoutError class

TimeoutError is emitted whenever certain operations are terminated due to timeout.

### Signature

```typescript
export declare class TimeoutError extends PuppeteerError
```

**Extends:** [PuppeteerError](./puppeteer.puppeteererror.md)

## Remarks

Example operations are [page.waitForSelector](./puppeteer.page.waitforselector.md) or [puppeteer.launch](./puppeteer.puppeteernode.launch.md).

    ---
sidebar_label: TouchError
---

# TouchError class

TouchError is thrown when an attempt is made to move or end a touch that does not exist.

### Signature

```typescript
export declare class TouchError extends PuppeteerError
```

**Extends:** [PuppeteerError](./puppeteer.puppeteererror.md)

    ---
sidebar_label: TouchHandle.end
---

# TouchHandle.end() method

Dispatches a `touchend` event for this touch.

### Signature

```typescript
interface TouchHandle {
  end(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: TouchHandle
---

# TouchHandle interface

The TouchHandle interface exposes methods to manipulate touches that have been started

### Signature

```typescript
export interface TouchHandle
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="end">[end()](./puppeteer.touchhandle.end.md)</span>

</td><td>

Dispatches a `touchend` event for this touch.

</td></tr>
<tr><td>

<span id="move">[move(x, y)](./puppeteer.touchhandle.move.md)</span>

</td><td>

Dispatches a `touchMove` event for this touch.

</td></tr>
</tbody></table>

    ---
sidebar_label: TouchHandle.move
---

# TouchHandle.move() method

Dispatches a `touchMove` event for this touch.

### Signature

```typescript
interface TouchHandle {
  move(x: number, y: number): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

x

</td><td>

number

</td><td>

Horizontal position of the move.

</td></tr>
<tr><td>

y

</td><td>

number

</td><td>

Vertical position of the move.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Touchscreen
---

# Touchscreen class

The Touchscreen class exposes touchscreen events.

### Signature

```typescript
export declare abstract class Touchscreen
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Touchscreen` class.

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="tap">[tap(x, y)](./puppeteer.touchscreen.tap.md)</span>

</td><td>

</td><td>

Dispatches a `touchstart` and `touchend` event.

</td></tr>
<tr><td>

<span id="touchend">[touchEnd()](./puppeteer.touchscreen.touchend.md)</span>

</td><td>

</td><td>

Dispatches a `touchend` event on the first touch that is active.

</td></tr>
<tr><td>

<span id="touchmove">[touchMove(x, y)](./puppeteer.touchscreen.touchmove.md)</span>

</td><td>

</td><td>

Dispatches a `touchMove` event on the first touch that is active.

**Remarks:**

Not every `touchMove` call results in a `touchmove` event being emitted, depending on the browser's optimizations. For example, Chrome [throttles](https://developer.chrome.com/blog/a-more-compatible-smoother-touch/#chromes-new-model-the-throttled-async-touchmove-model) touch move events.

</td></tr>
<tr><td>

<span id="touchstart">[touchStart(x, y)](./puppeteer.touchscreen.touchstart.md)</span>

</td><td>

</td><td>

Dispatches a `touchstart` event.

</td></tr>
</tbody></table>

    ---
sidebar_label: Touchscreen.tap
---

# Touchscreen.tap() method

Dispatches a `touchstart` and `touchend` event.

### Signature

```typescript
class Touchscreen {
  tap(x: number, y: number): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

x

</td><td>

number

</td><td>

Horizontal position of the tap.

</td></tr>
<tr><td>

y

</td><td>

number

</td><td>

Vertical position of the tap.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Touchscreen.touchEnd
---

# Touchscreen.touchEnd() method

Dispatches a `touchend` event on the first touch that is active.

### Signature

```typescript
class Touchscreen {
  touchEnd(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Touchscreen.touchMove
---

# Touchscreen.touchMove() method

Dispatches a `touchMove` event on the first touch that is active.

### Signature

```typescript
class Touchscreen {
  touchMove(x: number, y: number): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

x

</td><td>

number

</td><td>

Horizontal position of the move.

</td></tr>
<tr><td>

y

</td><td>

number

</td><td>

Vertical position of the move.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Not every `touchMove` call results in a `touchmove` event being emitted, depending on the browser's optimizations. For example, Chrome [throttles](https://developer.chrome.com/blog/a-more-compatible-smoother-touch/#chromes-new-model-the-throttled-async-touchmove-model) touch move events.

    ---
sidebar_label: Touchscreen.touchStart
---

# Touchscreen.touchStart() method

Dispatches a `touchstart` event.

### Signature

```typescript
class Touchscreen {
  abstract touchStart(x: number, y: number): Promise<TouchHandle>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

x

</td><td>

number

</td><td>

Horizontal position of the tap.

</td></tr>
<tr><td>

y

</td><td>

number

</td><td>

Vertical position of the tap.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[TouchHandle](./puppeteer.touchhandle.md)&gt;

A handle for the touch that was started.

    ---
sidebar_label: Tracing
---

# Tracing class

The Tracing class exposes the tracing audit interface.

### Signature

```typescript
export declare class Tracing
```

## Remarks

You can use `tracing.start` and `tracing.stop` to create a trace file which can be opened in Chrome DevTools or [timeline viewer](https://chromedevtools.github.io/timeline-viewer/).

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Tracing` class.

## Example

```ts
await page.tracing.start({path: 'trace.json'});
await page.goto('https://www.google.com');
await page.tracing.stop();
```

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="start">[start(options)](./puppeteer.tracing.start.md)</span>

</td><td>

</td><td>

Starts a trace for the current page.

**Remarks:**

Only one trace can be active at a time per browser.

</td></tr>
<tr><td>

<span id="stop">[stop()](./puppeteer.tracing.stop.md)</span>

</td><td>

</td><td>

Stops a trace started with the `start` method.

</td></tr>
</tbody></table>

    ---
sidebar_label: Tracing.start
---

# Tracing.start() method

Starts a trace for the current page.

### Signature

```typescript
class Tracing {
  start(options?: TracingOptions): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[TracingOptions](./puppeteer.tracingoptions.md)

</td><td>

_(Optional)_ Optional `TracingOptions`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

Only one trace can be active at a time per browser.

    ---
sidebar_label: Tracing.stop
---

# Tracing.stop() method

Stops a trace started with the `start` method.

### Signature

```typescript
class Tracing {
  stop(): Promise<Uint8Array | undefined>;
}
```

**Returns:**

Promise&lt;Uint8Array \| undefined&gt;

Promise which resolves to buffer with trace data.

    ---
sidebar_label: TracingOptions
---

# TracingOptions interface

### Signature

```typescript
export interface TracingOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="categories">categories</span>

</td><td>

`optional`

</td><td>

string\[\]

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`optional`

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="screenshots">screenshots</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: trimCache
---

# trimCache() function

### Signature

```typescript
trimCache: () => Promise<void>;
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: UnsupportedOperation
---

# UnsupportedOperation class

Puppeteer will throw this error if a method is not supported by the currently used protocol

### Signature

```typescript
export declare class UnsupportedOperation extends PuppeteerError
```

**Extends:** [PuppeteerError](./puppeteer.puppeteererror.md)

    ---
sidebar_label: VideoFormat
---

# VideoFormat type

### Signature

```typescript
export type VideoFormat = 'webm' | 'gif' | 'mp4';
```

    ---
sidebar_label: Viewport
---

# Viewport interface

### Signature

```typescript
export interface Viewport
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="devicescalefactor">deviceScaleFactor</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Specify device scale factor. See [devicePixelRatio](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio) for more info.

**Remarks:**

Setting this value to `0` will reset this value to the system default.

</td><td>

`1`

</td></tr>
<tr><td>

<span id="hastouch">hasTouch</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Specify if the viewport supports touch events.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="height">height</span>

</td><td>

</td><td>

number

</td><td>

The page height in CSS pixels.

**Remarks:**

Setting this value to `0` will reset this value to the system default.

</td><td>

</td></tr>
<tr><td>

<span id="islandscape">isLandscape</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Specifies if the viewport is in landscape mode.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="ismobile">isMobile</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether the `meta viewport` tag is taken into account.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="width">width</span>

</td><td>

</td><td>

number

</td><td>

The page width in CSS pixels.

**Remarks:**

Setting this value to `0` will reset this value to the system default.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: VisibilityOption
---

# VisibilityOption type

Whether to wait for the element to be [visible](./puppeteer.elementhandle.isvisible.md) or [hidden](./puppeteer.elementhandle.ishidden.md). `null` to disable visibility checks.

### Signature

```typescript
export type VisibilityOption = 'hidden' | 'visible' | null;
```

    ---
sidebar_label: WaitForNetworkIdleOptions
---

# WaitForNetworkIdleOptions interface

### Signature

```typescript
export interface WaitForNetworkIdleOptions extends WaitTimeoutOptions
```

**Extends:** [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="concurrency">concurrency</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Maximum number concurrent of network connections to be considered inactive.

</td><td>

`0`

</td></tr>
<tr><td>

<span id="idletime">idleTime</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Time (in milliseconds) the network should be idle.

</td><td>

`500`

</td></tr>
</tbody></table>

    ---
sidebar_label: WaitForOptions
---

# WaitForOptions interface

### Signature

```typescript
export interface WaitForOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="signal">signal</span>

</td><td>

`optional`

</td><td>

AbortSignal

</td><td>

A signal object that allows you to cancel the call.

</td><td>

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Maximum wait time in milliseconds. Pass 0 to disable the timeout.

The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) or [Page.setDefaultNavigationTimeout()](./puppeteer.page.setdefaultnavigationtimeout.md) methods.

</td><td>

`30000`

</td></tr>
<tr><td>

<span id="waituntil">waitUntil</span>

</td><td>

`optional`

</td><td>

[PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]

</td><td>

When to consider waiting succeeds. Given an array of event strings, waiting is considered to be successful after all events have been fired.

</td><td>

`'load'`

</td></tr>
</tbody></table>

    ---
sidebar_label: WaitForSelectorOptions
---

# WaitForSelectorOptions interface

### Signature

```typescript
export interface WaitForSelectorOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="hidden">hidden</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Wait for the selected element to not be found in the DOM or to be hidden. See [ElementHandle.isHidden()](./puppeteer.elementhandle.ishidden.md) for the definition of element invisibility.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="signal">signal</span>

</td><td>

`optional`

</td><td>

AbortSignal

</td><td>

A signal object that allows you to cancel a waitForSelector call.

</td><td>

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Maximum time to wait in milliseconds. Pass `0` to disable timeout.

The default value can be changed by using [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md)

</td><td>

`30_000` (30 seconds)

</td></tr>
<tr><td>

<span id="visible">visible</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Wait for the selected element to be present in DOM and to be visible. See [ElementHandle.isVisible()](./puppeteer.elementhandle.isvisible.md) for the definition of element visibility.

</td><td>

`false`

</td></tr>
</tbody></table>

    ---
sidebar_label: WaitForTargetOptions
---

# WaitForTargetOptions interface

### Signature

```typescript
export interface WaitForTargetOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="signal">signal</span>

</td><td>

`optional`

</td><td>

AbortSignal

</td><td>

A signal object that allows you to cancel a waitFor call.

</td><td>

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Maximum wait time in milliseconds. Pass `0` to disable the timeout.

</td><td>

`30_000`

</td></tr>
</tbody></table>

    ---
sidebar_label: WaitTimeoutOptions
---

# WaitTimeoutOptions interface

### Signature

```typescript
export interface WaitTimeoutOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="signal">signal</span>

</td><td>

`optional`

</td><td>

AbortSignal

</td><td>

A signal object that allows you to cancel a waitFor call.

</td><td>

</td></tr>
<tr><td>

<span id="timeout">timeout</span>

</td><td>

`optional`

</td><td>

number

</td><td>

Maximum wait time in milliseconds. Pass 0 to disable the timeout.

The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method.

</td><td>

`30_000`

</td></tr>
</tbody></table>

    ---
sidebar_label: WebWorker.close
---

# WebWorker.close() method

### Signature

```typescript
class WebWorker {
  close(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: WebWorker.evaluate
---

# WebWorker.evaluate() method

Evaluates a given function in the [worker](./puppeteer.webworker.md).

### Signature

```typescript
class WebWorker {
  evaluate<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(func: Func | string, ...args: Params): Promise<Awaited<ReturnType<Func>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

func

</td><td>

Func \| string

</td><td>

Function to be evaluated.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

Arguments to pass into `func`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;

The result of `func`.

## Remarks

If the given function returns a promise, [evaluate](./puppeteer.webworker.evaluate.md) will wait for the promise to resolve.

As a rule of thumb, if the return value of the given function is more complicated than a JSON object (e.g. most classes), then [evaluate](./puppeteer.webworker.evaluate.md) will \_likely\_ return some truncated value (or `{}`). This is because we are not returning the actual return value, but a deserialized version as a result of transferring the return value through a protocol to Puppeteer.

In general, you should use [evaluateHandle](./puppeteer.webworker.evaluatehandle.md) if [evaluate](./puppeteer.webworker.evaluate.md) cannot serialize the return value properly or you need a mutable [handle](./puppeteer.jshandle.md) to the return object.

    ---
sidebar_label: WebWorker.evaluateHandle
---

# WebWorker.evaluateHandle() method

Evaluates a given function in the [worker](./puppeteer.webworker.md).

### Signature

```typescript
class WebWorker {
  evaluateHandle<
    Params extends unknown[],
    Func extends EvaluateFunc<Params> = EvaluateFunc<Params>,
  >(
    func: Func | string,
    ...args: Params
  ): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

func

</td><td>

Func \| string

</td><td>

Function to be evaluated.

</td></tr>
<tr><td>

args

</td><td>

Params

</td><td>

Arguments to pass into `func`.

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[HandleFor](./puppeteer.handlefor.md)&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;&gt;

A [handle](./puppeteer.jshandle.md) to the return value of `func`.

## Remarks

If the given function returns a promise, [evaluate](./puppeteer.webworker.evaluate.md) will wait for the promise to resolve.

In general, you should use [evaluateHandle](./puppeteer.webworker.evaluatehandle.md) if [evaluate](./puppeteer.webworker.evaluate.md) cannot serialize the return value properly or you need a mutable [handle](./puppeteer.jshandle.md) to the return object.

    ---
sidebar_label: WebWorker
---

# WebWorker class

This class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).

### Signature

```typescript
export declare abstract class WebWorker extends EventEmitter<Record<EventType, unknown>>
```

**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;&gt;

## Remarks

The events `workercreated` and `workerdestroyed` are emitted on the page object to signal the worker lifecycle.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `WebWorker` class.

## Example

```ts
page.on('workercreated', worker =>
  console.log('Worker created: ' + worker.url()),
);
page.on('workerdestroyed', worker =>
  console.log('Worker destroyed: ' + worker.url()),
);

console.log('Current workers:');
for (const worker of page.workers()) {
  console.log('  ' + worker.url());
}
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="client">client</span>

</td><td>

`readonly`

</td><td>

[CDPSession](./puppeteer.cdpsession.md)

</td><td>

The CDP session client the WebWorker belongs to.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="close">[close()](./puppeteer.webworker.close.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="evaluate">[evaluate(func, args)](./puppeteer.webworker.evaluate.md)</span>

</td><td>

</td><td>

Evaluates a given function in the [worker](./puppeteer.webworker.md).

**Remarks:**

If the given function returns a promise, [evaluate](./puppeteer.webworker.evaluate.md) will wait for the promise to resolve.

As a rule of thumb, if the return value of the given function is more complicated than a JSON object (e.g. most classes), then [evaluate](./puppeteer.webworker.evaluate.md) will \_likely\_ return some truncated value (or `{}`). This is because we are not returning the actual return value, but a deserialized version as a result of transferring the return value through a protocol to Puppeteer.

In general, you should use [evaluateHandle](./puppeteer.webworker.evaluatehandle.md) if [evaluate](./puppeteer.webworker.evaluate.md) cannot serialize the return value properly or you need a mutable [handle](./puppeteer.jshandle.md) to the return object.

</td></tr>
<tr><td>

<span id="evaluatehandle">[evaluateHandle(func, args)](./puppeteer.webworker.evaluatehandle.md)</span>

</td><td>

</td><td>

Evaluates a given function in the [worker](./puppeteer.webworker.md).

**Remarks:**

If the given function returns a promise, [evaluate](./puppeteer.webworker.evaluate.md) will wait for the promise to resolve.

In general, you should use [evaluateHandle](./puppeteer.webworker.evaluatehandle.md) if [evaluate](./puppeteer.webworker.evaluate.md) cannot serialize the return value properly or you need a mutable [handle](./puppeteer.jshandle.md) to the return object.

</td></tr>
<tr><td>

<span id="url">[url()](./puppeteer.webworker.url.md)</span>

</td><td>

</td><td>

The URL of this web worker.

</td></tr>
</tbody></table>

    ---
sidebar_label: WebWorker.url
---

# WebWorker.url() method

The URL of this web worker.

### Signature

```typescript
class WebWorker {
  url(): string;
}
```

**Returns:**

string

    ---
sidebar_label: Browser
---

# Browser enum

Supported browsers.

### Signature

```typescript
export declare enum Browser
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

CHROME

</td><td>

`"chrome"`

</td><td>

</td></tr>
<tr><td>

CHROMEDRIVER

</td><td>

`"chromedriver"`

</td><td>

</td></tr>
<tr><td>

CHROMEHEADLESSSHELL

</td><td>

`"chrome-headless-shell"`

</td><td>

</td></tr>
<tr><td>

CHROMIUM

</td><td>

`"chromium"`

</td><td>

</td></tr>
<tr><td>

FIREFOX

</td><td>

`"firefox"`

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserPlatform
---

# BrowserPlatform enum

Platform names used to identify a OS platform x architecture combination in the way that is relevant for the browser download.

### Signature

```typescript
export declare enum BrowserPlatform
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

LINUX

</td><td>

`"linux"`

</td><td>

</td></tr>
<tr><td>

LINUX_ARM

</td><td>

`"linux_arm"`

</td><td>

</td></tr>
<tr><td>

MAC

</td><td>

`"mac"`

</td><td>

</td></tr>
<tr><td>

MAC_ARM

</td><td>

`"mac_arm"`

</td><td>

</td></tr>
<tr><td>

WIN32

</td><td>

`"win32"`

</td><td>

</td></tr>
<tr><td>

WIN64

</td><td>

`"win64"`

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: BrowserTag
---

# BrowserTag enum

Enum describing a release channel for a browser.

You can use this in combination with [resolveBuildId()](./browsers.resolvebuildid.md) to resolve a build ID based on a release channel.

### Signature

```typescript
export declare enum BrowserTag
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

BETA

</td><td>

`"beta"`

</td><td>

</td></tr>
<tr><td>

CANARY

</td><td>

`"canary"`

</td><td>

</td></tr>
<tr><td>

DEV

</td><td>

`"dev"`

</td><td>

</td></tr>
<tr><td>

DEVEDITION

</td><td>

`"devedition"`

</td><td>

</td></tr>
<tr><td>

ESR

</td><td>

`"esr"`

</td><td>

</td></tr>
<tr><td>

LATEST

</td><td>

`"latest"`

</td><td>

</td></tr>
<tr><td>

NIGHTLY

</td><td>

`"nightly"`

</td><td>

</td></tr>
<tr><td>

STABLE

</td><td>

`"stable"`

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: canDownload
---

# canDownload() function

### Signature

```typescript
export declare function canDownload(options: InstallOptions): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[InstallOptions](./browsers.installoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;boolean&gt;

    ---
sidebar_label: CDP_WEBSOCKET_ENDPOINT_REGEX
---

# CDP_WEBSOCKET_ENDPOINT_REGEX variable

### Signature

```typescript
CDP_WEBSOCKET_ENDPOINT_REGEX: RegExp;
```

    ---
sidebar_label: ChromeReleaseChannel
---

# ChromeReleaseChannel enum

### Signature

```typescript
export declare enum ChromeReleaseChannel
```

## Enumeration Members

<table><thead><tr><th>

Member

</th><th>

Value

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

BETA

</td><td>

`"beta"`

</td><td>

</td></tr>
<tr><td>

CANARY

</td><td>

`"canary"`

</td><td>

</td></tr>
<tr><td>

DEV

</td><td>

`"dev"`

</td><td>

</td></tr>
<tr><td>

STABLE

</td><td>

`"stable"`

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CLI.(constructor)
---

# CLI.(constructor)

Constructs a new instance of the `CLI` class

### Signature

```typescript
class CLI {
  constructor(
    opts?:
      | string
      | {
          cachePath?: string;
          scriptName?: string;
          version?: string;
          prefixCommand?: {
            cmd: string;
            description: string;
          };
          allowCachePathOverride?: boolean;
          pinnedBrowsers?: Partial<
            Record<
              Browser,
              {
                buildId: string;
                skipDownload: boolean;
              }
            >
          >;
        },
    rl?: readline.Interface,
  );
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

opts

</td><td>

string \| &#123; cachePath?: string; scriptName?: string; version?: string; prefixCommand?: &#123; cmd: string; description: string; &#125;; allowCachePathOverride?: boolean; pinnedBrowsers?: Partial&lt;Record&lt;[Browser](./browsers.browser.md), &#123; buildId: string; skipDownload: boolean; &#125;&gt;&gt;; &#125;

</td><td>

_(Optional)_

</td></tr>
<tr><td>

rl

</td><td>

readline.Interface

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

    ---
sidebar_label: CLI
---

# CLI class

### Signature

```typescript
export declare class CLI
```

## Constructors

<table><thead><tr><th>

Constructor

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_constructor_">[(constructor)(opts, rl)](./browsers.cli._constructor_.md)</span>

</td><td>

</td><td>

Constructs a new instance of the `CLI` class

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="run">[run(argv)](./browsers.cli.run.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: CLI.run
---

# CLI.run() method

### Signature

```typescript
class CLI {
  run(argv: string[]): Promise<void>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

argv

</td><td>

string\[\]

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: computeExecutablePath
---

# computeExecutablePath() function

### Signature

```typescript
export declare function computeExecutablePath(
  options: ComputeExecutablePathOptions,
): string;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[ComputeExecutablePathOptions](./browsers.options.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

string

    ---
sidebar_label: computeSystemExecutablePath
---

# computeSystemExecutablePath() function

Returns a path to a system-wide Chrome installation given a release channel name by checking known installation locations (using https://pptr.dev/browsers-api/browsers.computesystemexecutablepath/). If Chrome instance is not found at the expected path, an error is thrown.

### Signature

```typescript
export declare function computeSystemExecutablePath(
  options: SystemOptions,
): string;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[SystemOptions](./browsers.systemoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

string

    ---
sidebar_label: createProfile
---

# createProfile() function

### Signature

```typescript
export declare function createProfile(
  browser: Browser,
  opts: ProfileOptions,
): Promise<void>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

browser

</td><td>

[Browser](./browsers.browser.md)

</td><td>

</td></tr>
<tr><td>

opts

</td><td>

[ProfileOptions](./browsers.profileoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: detectBrowserPlatform
---

# detectBrowserPlatform() function

### Signature

```typescript
export declare function detectBrowserPlatform(): BrowserPlatform | undefined;
```

**Returns:**

[BrowserPlatform](./browsers.browserplatform.md) \| undefined

    ---
sidebar_label: getDownloadUrl
---

# getDownloadUrl() function

Retrieves a URL for downloading the binary archive of a given browser.

The archive is bound to the specific platform and build ID specified.

### Signature

```typescript
export declare function getDownloadUrl(
  browser: Browser,
  platform: BrowserPlatform,
  buildId: string,
  baseUrl?: string,
): URL;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

browser

</td><td>

[Browser](./browsers.browser.md)

</td><td>

</td></tr>
<tr><td>

platform

</td><td>

[BrowserPlatform](./browsers.browserplatform.md)

</td><td>

</td></tr>
<tr><td>

buildId

</td><td>

string

</td><td>

</td></tr>
<tr><td>

baseUrl

</td><td>

string

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

URL

    ---
sidebar_label: getInstalledBrowsers
---

# getInstalledBrowsers() function

Returns metadata about browsers installed in the cache directory.

### Signature

```typescript
export declare function getInstalledBrowsers(
  options: GetInstalledBrowsersOptions,
): Promise<InstalledBrowser[]>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[GetInstalledBrowsersOptions](./browsers.getinstalledbrowsersoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[InstalledBrowser](./browsers.installedbrowser.md)\[\]&gt;

    ---
sidebar_label: GetInstalledBrowsersOptions
---

# GetInstalledBrowsersOptions interface

### Signature

```typescript
export interface GetInstalledBrowsersOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="cachedir">cacheDir</span>

</td><td>

</td><td>

string

</td><td>

The path to the root of the cache directory.

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: getVersionComparator
---

# getVersionComparator() function

Returns a version comparator for the given browser that can be used to sort browser versions.

### Signature

```typescript
export declare function getVersionComparator(
  browser: Browser,
): (a: string, b: string) => number;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

browser

</td><td>

[Browser](./browsers.browser.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

(a: string, b: string) =&gt; number

    ---
sidebar_label: install
---

# install() function

<h2 id="install">install(): Promise&lt;InstalledBrowser&gt;</h2>

Downloads and unpacks the browser archive according to the [InstallOptions](./browsers.installoptions.md).

### Signature

```typescript
export declare function install(
  options: InstallOptions & {
    unpack?: true;
  },
): Promise<InstalledBrowser>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[InstallOptions](./browsers.installoptions.md) &amp; &#123; unpack?: true; &#125;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[InstalledBrowser](./browsers.installedbrowser.md)&gt;

a [InstalledBrowser](./browsers.installedbrowser.md) instance.

<h2 id="install-1">install(): Promise&lt;string&gt;</h2>

Downloads the browser archive according to the [InstallOptions](./browsers.installoptions.md) without unpacking.

### Signature

```typescript
export declare function install(
  options: InstallOptions & {
    unpack: false;
  },
): Promise<string>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[InstallOptions](./browsers.installoptions.md) &amp; &#123; unpack: false; &#125;

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string&gt;

the absolute path to the archive.

    ---
sidebar_label: InstalledBrowser
---

# InstalledBrowser class

### Signature

```typescript
export declare class InstalledBrowser
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `InstalledBrowser` class.

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="browser">browser</span>

</td><td>

</td><td>

[Browser](./browsers.browser.md)

</td><td>

</td></tr>
<tr><td>

<span id="buildid">buildId</span>

</td><td>

</td><td>

string

</td><td>

</td></tr>
<tr><td>

<span id="executablepath">executablePath</span>

</td><td>

`readonly`

</td><td>

string

</td><td>

</td></tr>
<tr><td>

<span id="path">path</span>

</td><td>

`readonly`

</td><td>

string

</td><td>

Path to the root of the installation folder. Use [computeExecutablePath()](./browsers.computeexecutablepath.md) to get the path to the executable binary.

</td></tr>
<tr><td>

<span id="platform">platform</span>

</td><td>

</td><td>

[BrowserPlatform](./browsers.browserplatform.md)

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="readmetadata">[readMetadata()](./browsers.installedbrowser.readmetadata.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="writemetadata">[writeMetadata(metadata)](./browsers.installedbrowser.writemetadata.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: InstalledBrowser.readMetadata
---

# InstalledBrowser.readMetadata() method

### Signature

```typescript
class InstalledBrowser {
  readMetadata(): Metadata;
}
```

**Returns:**

[Metadata](./browsers.metadata_2.md)

    ---
sidebar_label: InstalledBrowser.writeMetadata
---

# InstalledBrowser.writeMetadata() method

### Signature

```typescript
class InstalledBrowser {
  writeMetadata(metadata: Metadata): void;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

metadata

</td><td>

[Metadata](./browsers.metadata_2.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

void

    ---
sidebar_label: InstallOptions
---

# InstallOptions interface

### Signature

```typescript
export interface InstallOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="baseurl">baseUrl</span>

</td><td>

`optional`

</td><td>

string

</td><td>

Determines the host that will be used for downloading.

</td><td>

Either

- https://storage.googleapis.com/chrome-for-testing-public or - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central

</td></tr>
<tr><td>

<span id="browser">browser</span>

</td><td>

</td><td>

[Browser](./browsers.browser.md)

</td><td>

Determines which browser to install.

</td><td>

</td></tr>
<tr><td>

<span id="buildid">buildId</span>

</td><td>

</td><td>

string

</td><td>

Determines which buildId to download. BuildId should uniquely identify binaries and they are used for caching.

</td><td>

</td></tr>
<tr><td>

<span id="buildidalias">buildIdAlias</span>

</td><td>

`optional`

</td><td>

string

</td><td>

An alias for the provided `buildId`. It will be used to maintain local metadata to support aliases in the `launch` command.

</td><td>

</td></tr>
<tr><td>

<span id="cachedir">cacheDir</span>

</td><td>

</td><td>

string

</td><td>

Determines the path to download browsers to.

</td><td>

</td></tr>
<tr><td>

<span id="downloadprogresscallback">downloadProgressCallback</span>

</td><td>

`optional`

</td><td>

'default' \| ((downloadedBytes: number, totalBytes: number) =&gt; void)

</td><td>

Provides information about the progress of the download. If set to 'default', the default callback implementing a progress bar will be used.

</td><td>

</td></tr>
<tr><td>

<span id="installdeps">installDeps</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to attempt to install system-level dependencies required for the browser.

Only supported for Chrome on Debian or Ubuntu. Requires system-level privileges to run `apt-get`.

</td><td>

`false`

</td></tr>
<tr><td>

<span id="platform">platform</span>

</td><td>

`optional`

</td><td>

[BrowserPlatform](./browsers.browserplatform.md)

</td><td>

Determines which platform the browser will be suited for.

</td><td>

**Auto-detected.**

</td></tr>
<tr><td>

<span id="unpack">unpack</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to unpack and install browser archives.

</td><td>

`true`

</td></tr>
</tbody></table>

    ---
sidebar_label: launch
---

# launch() function

Launches a browser process according to [LaunchOptions](./browsers.launchoptions.md).

### Signature

```typescript
export declare function launch(opts: LaunchOptions): Process;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

opts

</td><td>

[LaunchOptions](./browsers.launchoptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

[Process](./browsers.process.md)

    ---
sidebar_label: LaunchOptions
---

# LaunchOptions interface

### Signature

```typescript
export interface LaunchOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="args">args</span>

</td><td>

`optional`

</td><td>

string\[\]

</td><td>

Additional arguments to pass to the executable when launching.

</td><td>

</td></tr>
<tr><td>

<span id="detached">detached</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Whether to spawn process in the [detached](https://nodejs.org/api/child_process.html#optionsdetached) mode.

</td><td>

`true` except on Windows.

</td></tr>
<tr><td>

<span id="dumpio">dumpio</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

If true, forwards the browser's process stdout and stderr to the Node's process stdout and stderr.

</td><td>

`false`.

</td></tr>
<tr><td>

<span id="env">env</span>

</td><td>

`optional`

</td><td>

Record&lt;string, string \| undefined&gt;

</td><td>

Environment variables to set for the browser process.

</td><td>

</td></tr>
<tr><td>

<span id="executablepath">executablePath</span>

</td><td>

</td><td>

string

</td><td>

Absolute path to the browser's executable.

</td><td>

</td></tr>
<tr><td>

<span id="handlesighup">handleSIGHUP</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Handles SIGHUP in the Node process and tries to gracefully close the browser process.

</td><td>

`true`.

</td></tr>
<tr><td>

<span id="handlesigint">handleSIGINT</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Handles SIGINT in the Node process and tries to kill the browser process.

</td><td>

`true`.

</td></tr>
<tr><td>

<span id="handlesigterm">handleSIGTERM</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Handles SIGTERM in the Node process and tries to gracefully close the browser process.

</td><td>

`true`.

</td></tr>
<tr><td>

<span id="onexit">onExit</span>

</td><td>

`optional`

</td><td>

() =&gt; Promise&lt;void&gt;

</td><td>

A callback to run after the browser process exits or before the process will be closed via the [Process.close()](./browsers.process.close.md) call (including when handling signals). The callback is only run once.

</td><td>

</td></tr>
<tr><td>

<span id="pipe">pipe</span>

</td><td>

`optional`

</td><td>

boolean

</td><td>

Configures stdio streams to open two additional streams for automation over those streams instead of WebSocket.

</td><td>

`false`.

</td></tr>
</tbody></table>

    ---
sidebar_label: makeProgressCallback
---

# makeProgressCallback() function

### Signature

```typescript
export declare function makeProgressCallback(
  browser: Browser,
  buildId: string,
): (downloadedBytes: number, totalBytes: number) => void;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

browser

</td><td>

[Browser](./browsers.browser.md)

</td><td>

</td></tr>
<tr><td>

buildId

</td><td>

string

</td><td>

</td></tr>
</tbody></table>

**Returns:**

(downloadedBytes: number, totalBytes: number) =&gt; void

    ---
sidebar_label: Metadata_2
---

# Metadata_2 interface

### Signature

```typescript
export interface Metadata
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="aliases">aliases</span>

</td><td>

</td><td>

Record&lt;string, string&gt;

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Options
---

# Options interface

### Signature

```typescript
export interface ComputeExecutablePathOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="browser">browser</span>

</td><td>

</td><td>

[Browser](./browsers.browser.md)

</td><td>

Determines which browser to launch.

</td><td>

</td></tr>
<tr><td>

<span id="buildid">buildId</span>

</td><td>

</td><td>

string

</td><td>

Determines which buildId to download. BuildId should uniquely identify binaries and they are used for caching.

</td><td>

</td></tr>
<tr><td>

<span id="cachedir">cacheDir</span>

</td><td>

</td><td>

string \| null

</td><td>

Root path to the storage directory.

Can be set to `null` if the executable path should be relative to the extracted download location. E.g. `./chrome-linux64/chrome`.

</td><td>

</td></tr>
<tr><td>

<span id="platform">platform</span>

</td><td>

`optional`

</td><td>

[BrowserPlatform](./browsers.browserplatform.md)

</td><td>

Determines which platform the browser will be suited for.

</td><td>

**Auto-detected.**

</td></tr>
</tbody></table>

    ---
sidebar_label: Process.(constructor)
---

# Process.(constructor)

Constructs a new instance of the `Process` class

### Signature

```typescript
class Process {
  constructor(opts: LaunchOptions);
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

opts

</td><td>

[LaunchOptions](./browsers.launchoptions.md)

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Process.close
---

# Process.close() method

### Signature

```typescript
class Process {
  close(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Process.hasClosed
---

# Process.hasClosed() method

### Signature

```typescript
class Process {
  hasClosed(): Promise<void>;
}
```

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: Process.kill
---

# Process.kill() method

### Signature

```typescript
class Process {
  kill(): void;
}
```

**Returns:**

void

    ---
sidebar_label: Process
---

# Process class

### Signature

```typescript
export declare class Process
```

## Constructors

<table><thead><tr><th>

Constructor

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="_constructor_">[(constructor)(opts)](./browsers.process._constructor_.md)</span>

</td><td>

</td><td>

Constructs a new instance of the `Process` class

</td></tr>
</tbody></table>

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="nodeprocess">nodeProcess</span>

</td><td>

`readonly`

</td><td>

childProcess.ChildProcess

</td><td>

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="close">[close()](./browsers.process.close.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="hasclosed">[hasClosed()](./browsers.process.hasclosed.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="kill">[kill()](./browsers.process.kill.md)</span>

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="waitforlineoutput">[waitForLineOutput(regex, timeout)](./browsers.process.waitforlineoutput.md)</span>

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: Process.waitForLineOutput
---

# Process.waitForLineOutput() method

### Signature

```typescript
class Process {
  waitForLineOutput(regex: RegExp, timeout?: number): Promise<string>;
}
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

regex

</td><td>

RegExp

</td><td>

</td></tr>
<tr><td>

timeout

</td><td>

number

</td><td>

_(Optional)_

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: ProfileOptions
---

# ProfileOptions interface

### Signature

```typescript
export interface ProfileOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="path">path</span>

</td><td>

</td><td>

string

</td><td>

</td><td>

</td></tr>
<tr><td>

<span id="preferences">preferences</span>

</td><td>

</td><td>

Record&lt;string, unknown&gt;

</td><td>

</td><td>

</td></tr>
</tbody></table>

    ---
sidebar_label: resolveBuildId
---

# resolveBuildId() function

### Signature

```typescript
export declare function resolveBuildId(
  browser: Browser,
  platform: BrowserPlatform,
  tag: string | BrowserTag,
): Promise<string>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

browser

</td><td>

[Browser](./browsers.browser.md)

</td><td>

</td></tr>
<tr><td>

platform

</td><td>

[BrowserPlatform](./browsers.browserplatform.md)

</td><td>

</td></tr>
<tr><td>

tag

</td><td>

string \| [BrowserTag](./browsers.browsertag.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;string&gt;

    ---
sidebar_label: SystemOptions
---

# SystemOptions interface

### Signature

```typescript
export interface SystemOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="browser">browser</span>

</td><td>

</td><td>

[Browser](./browsers.browser.md)

</td><td>

Determines which browser to launch.

</td><td>

</td></tr>
<tr><td>

<span id="channel">channel</span>

</td><td>

</td><td>

[ChromeReleaseChannel](./browsers.chromereleasechannel.md)

</td><td>

Release channel to look for on the system.

</td><td>

</td></tr>
<tr><td>

<span id="platform">platform</span>

</td><td>

`optional`

</td><td>

[BrowserPlatform](./browsers.browserplatform.md)

</td><td>

Determines which platform the browser will be suited for.

</td><td>

**Auto-detected.**

</td></tr>
</tbody></table>

    ---
sidebar_label: TimeoutError
---

# TimeoutError class

### Signature

```typescript
export declare class TimeoutError extends Error
```

**Extends:** Error

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `TimeoutError` class.

    ---
sidebar_label: uninstall
---

# uninstall() function

### Signature

```typescript
export declare function uninstall(options: UninstallOptions): Promise<void>;
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

options

</td><td>

[UninstallOptions](./browsers.uninstalloptions.md)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

    ---
sidebar_label: UninstallOptions
---

# UninstallOptions interface

### Signature

```typescript
export interface UninstallOptions
```

## Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead>
<tbody><tr><td>

<span id="browser">browser</span>

</td><td>

</td><td>

[Browser](./browsers.browser.md)

</td><td>

Determines which browser to uninstall.

</td><td>

</td></tr>
<tr><td>

<span id="buildid">buildId</span>

</td><td>

</td><td>

string

</td><td>

The browser build to uninstall

</td><td>

</td></tr>
<tr><td>

<span id="cachedir">cacheDir</span>

</td><td>

</td><td>

string

</td><td>

The path to the root of the cache directory.

</td><td>

</td></tr>
<tr><td>

<span id="platform">platform</span>

</td><td>

`optional`

</td><td>

[BrowserPlatform](./browsers.browserplatform.md)

</td><td>

Determines the platform for the browser binary.

</td><td>

**Auto-detected.**

</td></tr>
</tbody></table>

    ---
sidebar_label: WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX
---

# WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX variable

### Signature

```typescript
WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX: RegExp;
```

    ---
sidebar_label: API
---

# @puppeteer/browsers

Manage and launch browsers/drivers from a CLI or programmatically.

## System requirements

- A compatible Node version (see `engines` in `package.json`).
- For Firefox downloads:
  - Linux builds: `xz` and `bzip2` utilities are required to unpack `.tar.gz` and `.tar.bz2` archives.
  - MacOS builds: `hdiutil` is required to unpack `.dmg` archives.

## CLI

Use `npx` to run the CLI:

```bash
# This will install and run the @puppeteer/browsers package.
# If it is already installed in the current directory, the installed
# version will be used.
npx @puppeteer/browsers --help
```

Built-in per-command `help` will provide all documentation you need to use the CLI.

```bash
npx @puppeteer/browsers --help # help for all commands
npx @puppeteer/browsers install --help # help for the install command
npx @puppeteer/browsers launch --help # help for the launch command
npx @puppeteer/browsers clear --help # help for the clear command
npx @puppeteer/browsers list --help # help for the list command
```

You can specify the version of the `@puppeteer/browsers` when using
`npx`:

```bash
# Always install and use the latest version from the registry.
npx @puppeteer/browsers@latest --help
# Always use a specifc version.
npx @puppeteer/browsers@2.4.1 --help
# Always install the latest version and automatically confirm the installation.
npx --yes @puppeteer/browsers@latest --help
```

To clear all installed browsers, use the `clear` command:

```bash
npx @puppeteer/browsers clear
```

To list all installed browsers, use the `list` command:

```bash
npx @puppeteer/browsers list
```

Some example to give an idea of what the CLI looks like (use the `--help` command for more examples):

```sh
# Download the latest available Chrome for Testing binary corresponding to the Stable channel.
npx @puppeteer/browsers install chrome@stable

# Download a specific Chrome for Testing version.
npx @puppeteer/browsers install chrome@116.0.5793.0

# Download the latest Chrome for Testing version for the given milestone.
npx @puppeteer/browsers install chrome@117

# Download the latest available ChromeDriver version corresponding to the Canary channel.
npx @puppeteer/browsers install chromedriver@canary

# Download a specific ChromeDriver version.
npx @puppeteer/browsers install chromedriver@116.0.5793.0

# On Ubuntu/Debian and only for Chrome, install the browser and required system dependencies.
# If the browser version has already been installed, the command
# will still attempt to install system dependencies.
# Requires root privileges.
npx puppeteer browsers install chrome --install-deps
```

## Known limitations

1. Launching the system browsers is only possible for Chrome/Chromium.

## API

The programmatic API allows installing and launching browsers from your code. See the `test` folder for examples on how to use the `install`, `canInstall`, `launch`, `computeExecutablePath`, `computeSystemExecutablePath` and other methods.

## Classes

<table><thead><tr><th>

Class

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="cli">[CLI](./browsers.cli.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="installedbrowser">[InstalledBrowser](./browsers.installedbrowser.md)</span>

</td><td>

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `InstalledBrowser` class.

</td></tr>
<tr><td>

<span id="process">[Process](./browsers.process.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="timeouterror">[TimeoutError](./browsers.timeouterror.md)</span>

</td><td>

**Remarks:**

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `TimeoutError` class.

</td></tr>
</tbody></table>

## Enumerations

<table><thead><tr><th>

Enumeration

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="browser">[Browser](./browsers.browser.md)</span>

</td><td>

Supported browsers.

</td></tr>
<tr><td>

<span id="browserplatform">[BrowserPlatform](./browsers.browserplatform.md)</span>

</td><td>

Platform names used to identify a OS platform x architecture combination in the way that is relevant for the browser download.

</td></tr>
<tr><td>

<span id="browsertag">[BrowserTag](./browsers.browsertag.md)</span>

</td><td>

Enum describing a release channel for a browser.

You can use this in combination with [resolveBuildId()](./browsers.resolvebuildid.md) to resolve a build ID based on a release channel.

</td></tr>
<tr><td>

<span id="chromereleasechannel">[ChromeReleaseChannel](./browsers.chromereleasechannel.md)</span>

</td><td>

</td></tr>
</tbody></table>

## Functions

<table><thead><tr><th>

Function

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="candownload">[canDownload(options)](./browsers.candownload.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="computeexecutablepath">[computeExecutablePath(options)](./browsers.computeexecutablepath.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="computesystemexecutablepath">[computeSystemExecutablePath(options)](./browsers.computesystemexecutablepath.md)</span>

</td><td>

Returns a path to a system-wide Chrome installation given a release channel name by checking known installation locations (using https://pptr.dev/browsers-api/browsers.computesystemexecutablepath/). If Chrome instance is not found at the expected path, an error is thrown.

</td></tr>
<tr><td>

<span id="createprofile">[createProfile(browser, opts)](./browsers.createprofile.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="detectbrowserplatform">[detectBrowserPlatform()](./browsers.detectbrowserplatform.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="getdownloadurl">[getDownloadUrl(browser, platform, buildId, baseUrl)](./browsers.getdownloadurl.md)</span>

</td><td>

Retrieves a URL for downloading the binary archive of a given browser.

The archive is bound to the specific platform and build ID specified.

</td></tr>
<tr><td>

<span id="getinstalledbrowsers">[getInstalledBrowsers(options)](./browsers.getinstalledbrowsers.md)</span>

</td><td>

Returns metadata about browsers installed in the cache directory.

</td></tr>
<tr><td>

<span id="getversioncomparator">[getVersionComparator(browser)](./browsers.getversioncomparator.md)</span>

</td><td>

Returns a version comparator for the given browser that can be used to sort browser versions.

</td></tr>
<tr><td>

<span id="install">[install(options)](./browsers.install.md)</span>

</td><td>

Downloads and unpacks the browser archive according to the [InstallOptions](./browsers.installoptions.md).

</td></tr>
<tr><td>

<span id="install">[install(options)](./browsers.install.md)</span>

</td><td>

Downloads the browser archive according to the [InstallOptions](./browsers.installoptions.md) without unpacking.

</td></tr>
<tr><td>

<span id="launch">[launch(opts)](./browsers.launch.md)</span>

</td><td>

Launches a browser process according to [LaunchOptions](./browsers.launchoptions.md).

</td></tr>
<tr><td>

<span id="makeprogresscallback">[makeProgressCallback(browser, buildId)](./browsers.makeprogresscallback.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="resolvebuildid">[resolveBuildId(browser, platform, tag)](./browsers.resolvebuildid.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="uninstall">[uninstall(options)](./browsers.uninstall.md)</span>

</td><td>

</td></tr>
</tbody></table>

## Interfaces

<table><thead><tr><th>

Interface

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="getinstalledbrowsersoptions">[GetInstalledBrowsersOptions](./browsers.getinstalledbrowsersoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="installoptions">[InstallOptions](./browsers.installoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="launchoptions">[LaunchOptions](./browsers.launchoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="metadata_2">[Metadata_2](./browsers.metadata_2.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="options">[Options](./browsers.options.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="profileoptions">[ProfileOptions](./browsers.profileoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="systemoptions">[SystemOptions](./browsers.systemoptions.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="uninstalloptions">[UninstallOptions](./browsers.uninstalloptions.md)</span>

</td><td>

</td></tr>
</tbody></table>

## Variables

<table><thead><tr><th>

Variable

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

<span id="cdp_websocket_endpoint_regex">[CDP_WEBSOCKET_ENDPOINT_REGEX](./browsers.cdp_websocket_endpoint_regex.md)</span>

</td><td>

</td></tr>
<tr><td>

<span id="webdriver_bidi_websocket_endpoint_regex">[WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX](./browsers.webdriver_bidi_websocket_endpoint_regex.md)</span>

</td><td>

</td></tr>
</tbody></table>

    # Contributing

First of all, thank you for your interest in Puppeteer! We'd love to accept your
patches and contributions!

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to &lt;[https://cla.developers.google.com/](https://cla.developers.google.com/)&gt; to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Getting started

1. Clone this repository

   ```bash
   git clone https://github.com/puppeteer/puppeteer
   cd puppeteer
   ```

   or

   [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=90796663&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json)

2. Install the dependencies

   ```bash
   npm install
   # Or to download Firefox by default
   PUPPETEER_BROWSER=firefox npm install
   ```

3. Build all packages

   ```bash
   npm run build
   ```

4. Run all tests

   ```bash
   npm test
   ```

## Building a single package

To build a single package, you can run:

```bash
npm run build --workspace <package> # e.g. puppeteer
```

This will build all dependent packages automatically, so specifying a single
package is sufficient. This is all possible due to
[wireit](https://github.com/google/wireit) which behaves similar to
[GNU Make](https://www.gnu.org/software/make/).

### Watch mode

To continuously build a package, you can run:

```bash
npm run build --watch --workspace <package> # e.g. puppeteer
```

You have to only specify a single package to watch else things will not work as expected
As stated above because of [wireit](https://github.com/google/wireit) when a change happens
all dependencies will be build or rebuild (if needed).

## Removing stale artifacts

It's possible some generated artifacts (such as
`packages/puppeteer-core/src/types.ts`) can become stale since these artifacts
rely on complex conditions (such as names of distinct files) that cannot be
captured by the build system. To clean artifacts, you can run

```bash
npm run clean
# or specify the package
npm run clean --workspace <package>
```

## Comprehensive testing

Outside of `npm test`, there are several other
[`npm` scripts](https://docs.npmjs.com/cli/using-npm/scripts) that are
usually check through CI:

- `test-install` - Tests whether `puppeteer` and `puppeteer-core` install
  properly and are functional.
- `test-types` - Tests the TypeScript types in `puppeteer` using
  [`tsd`](https://github.com/SamVerschueren/tsd).
- `test:chrome:**` - Tests `puppeteer` on Chrome.
- `test:firefox:**` - Tests `puppeteer` on Firefox.
- `unit` - Runs unit tests.

The default `npm test` runs `test:{chrome,firefox}:headless` which is generally
sufficient.

Puppeteer uses a custom test runner on top of Mocha that consults the
[TestExpectations.json](https://github.com/puppeteer/puppeteer/blob/main/test/TestExpectations.json)
to see if a given test result is expected or not. See more info about the test
runner in
[`tools/mocha-runner`](https://github.com/puppeteer/puppeteer/tree/main/tools/mocha-runner).

### Unit tests

Tests that only test code (without the running browser) are put next to the classes they test
and run using the Node test runner (requires Node 20+):

```bash
npm run unit
```

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Code Style

Our coding style is fully defined in
[`eslint.config`](https://github.com/puppeteer/puppeteer/blob/main/eslint.config.mjs)
([ESLint](https://eslint.org/)) and
[`.prettierrc.cjs`](https://github.com/puppeteer/puppeteer/blob/main/.prettierrc.cjs)
([Prettier](https://prettier.io)).

Code is checked for PRs automatically and you can check your code
manually by running:

```bash
npm run lint
```

If some errors are returned, you can attempt to fix them using:

```bash
npm run format
```

## Project structure

The following is a description of the primary folders in Puppeteer:

- `packages` contains all public source code.
- `test` contains all test source code.
- `test-d` contains type tests using
  [`tsd`](https://github.com/SamVerschueren/tsd).
- `tools` contains miscellaneous scripts that are used in building and etc.
- `tools/mocha-runner` - contains the source code for our test runner.

## API guidelines

When authoring new API methods, consider the following:

- Expose as little information as needed. When in doubt, don’t expose new
  information.
- Methods are used in favor of getters/setters.
  - The only exception is namespaces, e.g. `page.keyboard` and `page.coverage`
- All string literals must be small case. This includes event names and option
  values.
- Avoid adding "sugar" API (API that is trivially implementable in user-space)
  unless they're **extremely** demanded.

## Commit messages

Commit messages should follow
[the Conventional Commits format](https://www.conventionalcommits.org/en/v1.0.0/#summary).

In particular, breaking changes should clearly be noted as “BREAKING CHANGE:” in
the commit message footer. Example:

```
fix(page): fix page.pizza method

This patch fixes page.pizza so that it works with iframes.

Issues: #123, #234

BREAKING CHANGE: page.pizza now delivers pizza at home by default.
To deliver to a different location, use the "deliver" option:
  `page.pizza({deliver: 'work'})`.
```

## Writing documentation

Documentation is generated from TSDoc comments via `npm run docs`. It is automatically
published to our documentation site on merge and gets versioned on release.

This means that you should not change the markdown in files `docs/api` manually.

## Writing TSDoc comments

Each change to Puppeteer should be thoroughly documented using TSDoc comments.
Refer to the
[API Extractor documentation](https://api-extractor.com/pages/tsdoc/doc_comment_syntax/)
for information on the exact syntax.

- Every new method needs to have either `@public` or `@internal` added as a tag
  depending on if it is part of the public API.
- Keep each line in a comment to no more than 90 characters (ESLint will warn
  you if you go over this). If you're a VSCode user the
  [Rewrap plugin](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap)
  is highly recommended!

## Running the documentation site locally

1. At root, install all dependencies with `npm i --ignore-scripts`.
2. run `npm run docs` which will generate all the `.md` files on
   `puppeteer/docs/api`.
3. run `npm i` in `puppeteer/website`.
4. run `npm start` in `puppeteer/website`.

## Adding new dependencies

For all dependencies (both installation and development):

- **Do not add** a dependency if the desired functionality is easily
  implementable.
- If adding a dependency, it should be well-maintained and trustworthy.

A barrier for introducing new installation dependencies is especially high:

- **Do not add** installation dependency unless it's critical to project
  success.

There are additional considerations for dependencies that are environment
agonistic. See the
[`third_party/README.md`](https://github.com/puppeteer/puppeteer/blob/main/packages/puppeteer-core/third_party/README.md)
for details.

## Testing tips

- Every feature should be accompanied by a test.
- Every public api event/method should be accompanied by a test.
- Tests should not depend on external services.
- Tests should work on all three platforms: Mac, Linux and Win. This is
  especially important for screenshot tests.

If a test is expected to fail on certain configurations or became flaky, update
[TestExpectations.json](https://github.com/puppeteer/puppeteer/blob/main/test/TestExpectations.json)
to reflect that. See more info about TestExpectations.json in
[`tools/mocha-runner`](https://github.com/puppeteer/puppeteer/tree/main/tools/mocha-runner).

## API Coverage

Every public API method or event should be called at least once in tests. To
ensure this, the main `test` command runs coverage during testing.

## Debugging Puppeteer

See [Debugging Tips](https://pptr.dev/guides/debugging).

### Debugging Puppeteer tests via VSCode

Copy the provided default `.vscode/launch.template.json` to `.vscode/launch.json` and then use the integrated VSCode debugger to debug test.

Remember to build test before launching via:

```bash
npm run build --workspace @puppeteer-test/test
```

# For Project Maintainers

## Rolling new Chrome version

There is a [GitHub action](https://github.com/puppeteer/puppeteer/blob/main/.github/workflows/update-browser-pins.yml) that runs once per day.
The action has a manual trigger that can be found on the [Actions Tab](https://github.com/puppeteer/puppeteer/actions/workflows/update-browser-pins.yml).

### Manual instructions

You can run the [`tools/update_browser_revision.mjs`](https://github.com/puppeteer/puppeteer/blob/main/tools/update_browser_revision.mjs) locally
and try see if any changes need to be committed.

> Note: You may need to run `node --experimental-fetch tools/update_browser_revision.mjs` as the script relies on `fetch`

The following steps are manual version of the script above.

1. Find a suitable Chrome `revision` and `version` via https://googlechromelabs.github.io/chrome-for-testing/ or https://chromiumdash.appspot.com/.
2. Update `packages/puppeteer-core/src/revisions.ts` with the found `version`
   number.
3. Update `versions.json` with the new Chrome-to-Puppeteer `version` mapping and
   update `lastMaintainedChromeVersion` with the next one in from the list.
4. Run `npm run check`. If it fails, update
   `packages/puppeteer-core/package.json`
   with the expected `devtools-protocol` version and run `npm install` to generate an updated `package-lock.json`.
5. Run `npm run clean`, `npm install` and `npm run build`.
6. Run `npm test` and ensure that all tests pass. If a test fails,
   [bisect](#bisecting-upstream-changes) the upstream cause of the failure, and
   either update the test expectations accordingly (if it was an intended
   change) or work around the changes in Puppeteer (if it’s not desirable to
   change Puppeteer’s observable behavior).
7. Commit and push your changes and open a pull request. The commit message must
   contain the version in `Chrome <version>` format to ensure
   that [pptr.dev](https://pptr.dev/) can parse it correctly, e.g.
   `feat(chrome): roll to Chrome 90.0.4427.0`.

### Bisecting upstream changes

For bisecting Chrome/Chromium changes use https://www.chromium.org/developers/bisect-builds-py/.

```bash
python3 <path-to-chromium-checkout>/tools/bisect-builds.py -g <known-good> -b <known-bad> -cft -v --verify-range --not-interactive -c "BINARY=%p npm run test:chrome:<test-type>"
```

Or run the wrapper in `tools/bisect.mjs` that warps the above functionality for Puppeteer tests.

```bash
# From Puppeteer repo root
node tools/bisect.mjs -g <known-good> -b <known-bad>
```

## Releasing to npm

We use [release-please](https://github.com/googleapis/release-please) to
automate releases. When a release should be done, check for the release PR in
our [pull requests](https://github.com/puppeteer/puppeteer/pulls) and merge it.

### In case Release Please fails

<!-- TODO: Remove once release-please is fixed -->

In the event release-please fails, the following needs to be done:

1. Update anything missing in the CHANGELOG of every package that was supposed
   to be published. For example, if the header is missing, you may need to add
   - For puppeteer:

     ```md
     ## [{NEW_VERSION}](https://github.com/puppeteer/puppeteer/compare/v{PREVIOUS_VERSION}...v{NEW_VERSION}) ({CURRENT_DATE})`
     ```

   - For other packages:

     ```md
     ## [{NEW_VERSION}](https://github.com/puppeteer/puppeteer/compare/{PACKAGE_FOLDER_NAME}-v{PREVIOUS_VERSION}...{PACKAGE_FOLDER_NAME}-v{NEW_VERSION}) ({CURRENT_DATE})
     ```

2. Create a GitHub release for each package, following the practice of previous
   releases.

## Bug triage guidelines

[Check incoming bug reports](https://github.com/puppeteer/puppeteer/issues) that do not have a `confirmed` or `needs-feedback` label:

1. Make sure the issue is labeled as either `bug` or `feature`.
2. If the issue does not have a clear repro or you cannot repro, ask for the repro and set the `needs-feedback` label.
3. Follow-up on the issues you previously asked for a feedback on (you should get a notification on GitHub when the user responds).
4. If the user does not provide feedback, the issue will be closed by the stale bot eventually.
5. If you are able to reproduce the issue, add the label `confirmed`.
6. If the bug is on the Chromium side, create a corresponding crbug.com issue, label the GitHub issue with the `upstream` label, and post a link to crbug.com in the comments.
7. If the issue is not related to either Puppeteer or Chromium, close the issue.
8. If the issue is about missing/incorrect documentation, label it as `documentation`.

Issues with PDFs:

1. If the issue reproduces using the regular print dialog and/or headful, [file a crbug.com against the `Blink>Layout` component](https://bugs.chromium.org/p/chromium/issues/entry?components=Blink%3ELayout).
2. If the issue is specific to Headless mode, [file an issue on crbug.com against the `Internals>Headless` component](https://bugs.chromium.org/p/chromium/issues/entry?components=Internals%3EHeadless).

    # Examples & Use cases

## Official examples

[The Puppeteer repository](https://github.com/puppeteer/puppeteer/tree/main/examples) includes a small number of examples maintained by the Puppeteer team.

Follow the instructions in the README to run the examples, covering use cases like creating PDFs from websites, creating screenshots or intercepting requests.

## Example suite

Find a set of unstructured examples in Puppeteer's dedicated [example repository](https://github.com/puppeteer/examples).

This suite is a collection of examples that has been growing over time and covers various use cases like forwarding events
from your Puppeteer process to the browser, interacting with elements and running CDP commands.

## Other projects, articles and demos

See the following list for use cases and examples from categories like Rendering, Web scraping and Testing.

### Rendering and web scraping

- **[Puppetron](https://github.com/cheeaun/puppetron)**: Demo site that shows
  how to use Puppeteer and Headless Chrome to render pages. Inspired by
  [GoogleChrome/rendertron](https://github.com/GoogleChrome/rendertron).
- **[Thal](https://medium.com/@e_mad_ehsan/getting-started-with-puppeteer-and-chrome-headless-for-web-scrapping-6bf5979dee3e)**:
  Get started with Puppeteer and Chrome Headless for Web Scraping.
- **[pupperender](https://github.com/LasaleFamine/pupperender)**: Express
  middleware that checks the User-Agent header of incoming requests, and if
  it matches one of a configurable set of bots, render the page using Puppeteer.
  Useful for PWA rendering.
- **[headless-chrome-crawler](https://github.com/yujiosaka/headless-chrome-crawler)**:
  Crawler that provides APIs to manipulate Headless Chrome and lets you crawl
  dynamic websites.
- **[Puppeteer examples from Checkly](https://web.archive.org/web/20240811200732/https://www.checklyhq.com/learn/headless/basics-puppeteer-intro/)**:
  E2E Puppeteer examples for real life use cases, such as getting
  useful info from the web pages or common login scenarios.
- **[browserless](https://github.com/browserless/browserless)**: Headless
  Chrome as a service letting you execute Puppeteer scripts remotely.
- **[Puppeteer on AWS Lambda](https://github.com/jay-deshmukh/headless-chrome-with-puppeteer-on-AWS-lambda-with-serverless-framework)**:
  Run puppeteer on AWS Lambda with Serverless framework
- **[Apify SDK](https://github.com/apifytech/apify-js)**: The scalable web
  crawling and scraping library for JavaScript. Automatically manages a pool of
  Puppeteer browsers and provides error handling, task management, proxy
  rotation and more.

### Testing

- **[angular-puppeteer-demo](https://github.com/Quramy/angular-puppeteer-demo)**:
  Demo repository explaining how to use Puppeteer in Karma.
- **[mocha-headless-chrome](https://github.com/direct-adv-interfaces/mocha-headless-chrome)**:
  Tool which runs client-side mocha tests in the command line through headless
  Chrome.
- **[puppeteer-to-istanbul-example](https://github.com/bcoe/puppeteer-to-istanbul-example)**:
  Demo repository demonstrating how to output Puppeteer coverage in Istanbul
  format.
- **[jest-puppeteer](https://github.com/smooth-code/jest-puppeteer)**: (almost)
  Zero configuration tool for setting up and running Jest and Puppeteer. Also
  includes an assertion library for Puppeteer.
- **[puppeteer-har](https://github.com/Everettss/puppeteer-har)**: Generate HAR
  file with puppeteer.
- **[puppetry](https://puppetry.app/)**: A desktop app to build Puppeteer and
  Jest driven tests without coding.
- **[puppeteer-loadtest](https://github.com/svenkatreddy/puppeteer-loadtest)**:
  command line interface for performing load test on Puppeteer scripts.
- **[cucumber-puppeteer-example](https://github.com/mlampedx/cucumber-puppeteer-example)**:
  Example repository demonstrating how to use Puppeeteer and Cucumber for
  integration testing.

    # FAQ

## Q: Who maintains Puppeteer?

The Chrome Browser Automation team maintains the library, but we'd love your help and
expertise on the project! See our
[contributing guide](https://pptr.dev/contributing).

## Q: What is the status of cross-browser support?

From Puppeteer v23.0.0 onwards Puppeteer provides support for both Chrome and Firefox.

To automate Chrome Puppeteer uses the Chrome DevTools Protocol (CDP) by default, but it can
also be automated using WebDriver BiDi which is the default for automating Firefox.

To understand the subtle differences in API support refer to our
[WebDriver BiDi guide](https://pptr.dev/webdriver-bidi).

## Q: Does Puppeteer support WebDriver BiDi?

From Puppeteer v23.0.0 and up Puppeteer has production-ready support for WebDriver BiDi
to automate both Chrome and Firefox.

## Q: Will keep Puppeteer supporting CDP?

We are not going to stop supporting automation of Chrome with CDP - despite
Puppeteer's support for WebDriver BiDi. To not break existing automations relying on CDP,
but also to keep enabling automation use-cases unique to Chrome and not standardized
with WebDriver BiDi.

## Q: What are Puppeteer’s goals and principles?

The goals of the project are:

- Provide a reference implementation that highlights the capabilities of the
  [Chrome DevTools](https://chromedevtools.github.io/devtools-protocol/)
  and [WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) protocols.
- Grow the adoption of automated cross-browser testing.
- Help dogfood new DevTools Protocol and WebDriver BiDi features...and catch bugs!
- Learn more about the pain points of automated browser testing and help fill
  those gaps.

We adapt
[Chromium principles](https://www.chromium.org/developers/core-principles) to
help us drive product decisions:

- **Speed**: Puppeteer has almost zero performance overhead over an automated
  page.
- **Security**: Puppeteer operates off-process with respect to the browser, making
  it safe to automate potentially malicious pages.
- **Stability**: Puppeteer should not be flaky and should not leak memory.
- **Simplicity**: Puppeteer provides a high-level API that’s easy to use,
  understand, and debug.

## Q: Is Puppeteer a replacement for Selenium?

Puppeteer is a Node.js based reference implementation of how to automate browsers
with CDP and WebDriver BiDi - the same web standard the Selenium project is also
contributing to.

The Selenium project goes beyond what Puppeteer offers in multiple aspects: it provides
bindings for more languages than just JavaScript and for example it also offers tooling
to orchestrate automation at large, like Selenium Grid. Both is beyond Puppeteer's scope.

There are community projects that add capabilities to Puppeteer beyond its core,
making things like testing more convenient. For example see:

- [jest-puppeteer](https://github.com/smooth-code/jest-puppeteer) or
- [Puppeteer's Angular integration](https://pptr.dev/integrations/ng-schematics)

## Q: Why doesn’t Puppeteer v.XXX work with a certain version of Chrome or Firefox?

Every Puppeteer release is tightly bundled with a specific browser release
to ensure compatibility with the implementation of the underlying protocols,
the Chrome DevTools Protocol and WebDriver BiDi.

This is to prevent changes in either [Chrome](https://pptr.dev/supported-browsers#chrome) or [Firefox](https://pptr.dev/supported-browsers#firefox) from unexpectedly breaking Puppeteer.

## Q: Which Chrome and Firefox version does Puppeteer use?

Look for the `chrome` and `firefox` entries in
[revisions.ts](https://github.com/puppeteer/puppeteer/blob/main/packages/puppeteer-core/src/revisions.ts).

## Q: What’s considered a “Navigation”?

From Puppeteer’s standpoint, **“navigation” is anything that changes a page’s
URL**. Aside from regular navigation where the browser hits the network to fetch
a new document from the web server, this includes
[anchor navigations](https://www.w3.org/TR/html5/single-page.html#scroll-to-fragid)
and [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API)
usage.

With this definition of “navigation,” **Puppeteer works seamlessly with
single-page applications.**

## Q: What’s the difference between a “trusted" and "untrusted" input event?

In browsers, input events could be divided into two big groups: trusted vs.
untrusted.

- **Trusted events**: events generated by users interacting with the page, e.g.
  using a mouse or keyboard.
- **Untrusted event**: events generated by Web APIs, e.g. `document.createEvent`
  or `element.click()` methods.

Websites can distinguish between these two groups:

- using an
  [`Event.isTrusted`](https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted)
  event flag
- sniffing for accompanying events. For example, every trusted `'click'` event
  is preceded by `'mousedown'` and `'mouseup'` events.

For automation purposes it’s important to generate trusted events. **All input
events generated with Puppeteer are trusted and fire proper accompanying
events.** If, for some reason, one needs an untrusted event, it’s always
possible to hop into a page context with `page.evaluate` and generate a fake
event:

```ts
await page.evaluate(() => {
  document.querySelector('button[type=submit]').click();
});
```

## Q: Does Puppeteer support media and audio playback?

Puppeteer uses [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) binaries
by default which ship with properietary codecs support starting from
[M120](https://chromiumdash.appspot.com/commit/12d607016c31ea13579e897740c765be189ed6eb).

## Q: I am having trouble installing / running Puppeteer in my test environment. Where should I look for help?

We have a
[troubleshooting](https://pptr.dev/troubleshooting)
guide for various operating systems that lists the required dependencies.

## Q: I have more questions! Where do I ask?

There are many ways to get help on Puppeteer:

- For questions: [Stack Overflow](https://stackoverflow.com/questions/tagged/puppeteer)
- For bug reports: [GitHub Issues](https://github.com/puppeteer/puppeteer/issues)

Make sure to search these channels before posting your question.

    # Browser management

Usually, you start working with Puppeteer by either [launching](https://pptr.dev/api/puppeteer.puppeteernode.launch) or [connecting](https://pptr.dev/api/puppeteer.puppeteernode.connect) to a browser.

## Launching a browser

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();

const page = await browser.newPage();

// ...
```

## Closing a browser

To gracefully close the browser, you use the [`browser.close()`](https://pptr.dev/api/puppeteer.browser.close) method:

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();

const page = await browser.newPage();

await browser.close();
```

## Browser contexts

If you need to isolate your automation tasks, use [BrowserContexts](https://pptr.dev/api/puppeteer.browser.createbrowsercontext/). Cookies and local storage are not shared between browser contexts. Also, you can close all pages in the context by closing the context.

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();

const context = await browser.createBrowserContext();

const page1 = await context.newPage();
const page2 = await context.newPage();

await context.close();
```

## Permissions

You can also configure permissions for a browser context:

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const context = browser.defaultBrowserContext();

await context.overridePermissions('https://html5demos.com', ['geolocation']);
```

## Connecting to a running browser

If you launched a browser outside of Puppeteer, you can connect to it using the [`connect`](https://pptr.dev/api/puppeteer.puppeteernode.connect/) method. Usually, you can grab a WebSocket endpoint URL from the browser output:

```ts
const browser = await puppeteer.connect({
  browserWSEndpoint: 'ws://127.0.0.1:9222/...',
});

const page = await browser.newPage();

browser.disconnect();
```

:::note

Unlike `browser.close()`, `browser.disconnect()` does not shut down the browser or close any pages.

:::

    # Chrome Extensions

Puppeteer can be used for testing Chrome Extensions.

## Load extensions

### Using `LaunchOptions`

```ts
import puppeteer from 'puppeteer';
import path from 'path';

const pathToExtension = path.join(process.cwd(), 'my-extension');
const browser = await puppeteer.launch({
  pipe: true,
  enableExtensions: [pathToExtension],
});
```

### At runtime

```ts
import puppeteer from 'puppeteer';
import path from 'path';

const pathToExtension = path.join(process.cwd(), 'my-extension');
const browser = await puppeteer.launch({
  pipe: true,
  enableExtensions: true,
});

await browser.installExtension(pathToExtension);
```

## Background contexts

You can get a reference to the extension service worker or background page, which can be useful for evaluating code in the extension context or forcefully terminating the service worker.

### Service worker (MV3)

```ts
import puppeteer from 'puppeteer';
import path from 'path';

const pathToExtension = path.join(process.cwd(), 'my-extension');
const browser = await puppeteer.launch({
  pipe: true,
  enableExtensions: [pathToExtension],
});

const workerTarget = await browser.waitForTarget(
  // Assumes that there is only one service worker created by the extension and its URL ends with background.js.
  target =>
    target.type() === 'service_worker' &&
    target.url().endsWith('background.js'),
);

const worker = await workerTarget.worker();

// Test the service worker.

await browser.close();
```

### Background page (MV2)

The following is code for getting a handle to the
[background page](https://developer.chrome.com/extensions/background_pages) of
an extension whose source is located in `./my-extension`:

```ts
import puppeteer from 'puppeteer';
import path from 'path';

const pathToExtension = path.join(process.cwd(), 'my-extension');
const browser = await puppeteer.launch({
  pipe: true,
  enableExtensions: [pathToExtension],
});
const backgroundPageTarget = await browser.waitForTarget(
  target => target.type() === 'background_page',
);
const backgroundPage = await backgroundPageTarget.page();

// Test the background page as you would any other page.

await browser.close();
```

## Popup

Access the service worker [as above](#service-worker-mv3). Then:

```ts
await worker.evaluate('chrome.action.openPopup();');

const popupTarget = await browser.waitForTarget(
  // Assumes that there is only one page with the URL ending with popup.html
  // and that is the popup created by the extension.
  target => target.type() === 'page' && target.url().endsWith('popup.html'),
);

const popupPage = popupTarget.asPage();

// Test the popup page as you would any other page.

await browser.close();
```

## Content scripts

Content scripts are injected as normal. Use `browser.newPage()` and `page.goto()` to navigate to a page where a content script will be injected.

It is not currently possible to evaluate code in the content script isolated world.

## Learn more

To learn more, see the documentation on [Chrome for Developers](https://developer.chrome.com/docs/extensions/how-to/test/end-to-end-testing).

    # Configuration

By default, Puppeteer downloads and uses a specific version of Chrome so its
API is guaranteed to work out of the box. To use Puppeteer with a different
version of Chrome or Chromium, pass in the executable's path when creating a
`Browser` instance:

```ts
const browser = await puppeteer.launch({executablePath: '/path/to/Chrome'});
```

You can also use Puppeteer with Firefox. See
[status of cross-browser support](https://pptr.dev/faq#q-what-is-the-status-of-cross-browser-support) for
more information.

All defaults in Puppeteer can be customized in two ways:

1. [Configuration files](#configuration-files) (**recommended**)
2. [Environment variables](#environment-variables)

:::caution

Note that some options are only customizable through environment variables (such
as `HTTPS_PROXY`).

:::

:::caution

Puppeteer's configuration files and environment variables are ignored by `puppeteer-core`.

:::

## Configuration files

Configuration files are the **recommended** choice for configuring Puppeteer.
Puppeteer will look up the file tree for any of the following formats:

- `.puppeteerrc.cjs`,
- `.puppeteerrc.js`,
- `.puppeteerrc` (YAML/JSON),
- `.puppeteerrc.json`,
- `.puppeteerrc.yaml`,
- `puppeteer.config.js`, and
- `puppeteer.config.cjs`

See the [`Configuration`](../api/puppeteer.configuration) interface for possible
options.

### Changing download options

When the changes to the configuration include changes to download option,
you will need to re-run postinstall scripts for them to take effect.

This can most easily be done with running:

```bash npm2yarn
npx puppeteer browsers install
```

### Examples

#### Downloading multiple browsers

Starting with v23.0.0, Puppeteer allows downloading multiple browser
without the need to run multiple commands.

Update the Puppeteer configuration file:

```js title="project-directory/.puppeteerrc.cjs"
/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  // Download Chrome (default `skipDownload: false`).
  chrome: {
    skipDownload: false,
  },
  // Download Firefox (default `skipDownload: true`).
  firefox: {
    skipDownload: false,
  },
};
```

Run CLI to download the new configuration:

```bash npm2yarn
npx puppeteer browsers install
```

#### Changing the default cache directory

Starting in v19.0.0, Puppeteer stores browsers in `~/.cache/puppeteer` to
globally cache browsers between installation. This can cause problems if
`puppeteer` is packed during some build step and moved to a fresh location. The
following configuration can solve this issue (reinstall `puppeteer` to take
effect):

```js title="project-directory/.puppeteerrc.cjs"
const {join} = require('path');

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  // Changes the cache location for Puppeteer.
  cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};
```

:::note

Notice this is only possible with CommonJS configuration files as information
about the ambient environment is needed (in this case, `__dirname`).

:::

## Environment variables

Along with configuration files, Puppeteer looks for certain
[environment variables](https://en.wikipedia.org/wiki/Environment_variable) for
customizing behavior. Environment variables will always override configuration
file options when applicable.

The following options are _environment-only_ options

- `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` - defines HTTP proxy settings that are
  used to download and run the browser.

All other options can be found in the documentation for the
[`Configuration`](../api/puppeteer.configuration) interface.

    # Cookies

Puppeteer offers methods to get, set and delete cookies ahead of time by
manipulating browser storage directly. This is useful if you need to
store and restore specific cookies for your tests.

## Getting cookies

The following example demonstrates how to get cookies available in the
browser's default
[BrowserContext](https://pptr.dev/api/puppeteer.browsercontext/).

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();

const page = await browser.newPage();

await page.goto('https://example.com');

// In this example, we set a cookie using script evaluation.
// Cookies can be set by the page/server in various ways.
await page.evaluate(() => {
  document.cookie = 'myCookie = MyCookieValue';
});

console.log(await browser.cookies()); // print available cookies.
```

## Setting cookies

Puppeteer can also write cookies directly into the browser's storage:

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();

// Sets two cookies for the localhost domain.
await browser.setCookie(
  {
    name: 'cookie1',
    value: '1',
    domain: 'localhost',
    path: '/',
    sameParty: false,
    expires: -1,
    httpOnly: false,
    secure: false,
    sourceScheme: 'NonSecure',
  },
  {
    name: 'cookie2',
    value: '2',
    domain: 'localhost',
    path: '/',
    sameParty: false,
    expires: -1,
    httpOnly: false,
    secure: false,
    sourceScheme: 'NonSecure',
  },
);

console.log(await browser.cookies()); // print available cookies.
```

## Deleting cookies

[Browser.deleteCookie()](https://pptr.dev/api/puppeteer.browser.deletecookie) method allows deleting cookies from storage.

```ts
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();

// Deletes two cookies for the localhost domain.
await browser.deleteCookie(
  {
    name: 'cookie1',
    value: '1',
    domain: 'localhost',
    path: '/',
    sameParty: false,
    expires: -1,
    httpOnly: false,
    secure: false,
    sourceScheme: 'NonSecure',
  },
  {
    name: 'cookie2',
    value: '2',
    domain: 'localhost',
    path: '/',
    sameParty: false,
    expires: -1,
    httpOnly: false,
    secure: false,
    sourceScheme: 'NonSecure',
  },
);

console.log(await browser.cookies()); // print available cookies.
```

In addition to the `Browser` methods operating on the default browser
context, the same methods are available on the
[`BrowserContext`](https://pptr.dev/api/puppeteer.browsercontext) class.

    # Debugging

Debugging with Puppeteer can be an arduous task. There is no _single_ method for
debugging all possible issues since Puppeteer touches many distinct components
of a browser such as network requests and Web APIs. On a high note, Puppeteer
provides _several_ methods for debugging which hopefully do cover all possible
issues.

## Background

In general, there are two possible sources of an issue: Code running on Node.js
(which we call _server code_), and
[code running in the browser](../api/puppeteer.page.evaluate)
(which we call _client code_). There is also a third possible source being the
browser itself (which we call _internal code_ or _browser code_), but if you suspect this is the
source **after attempting the methods below**, we suggest
[searching existing issues](https://github.com/puppeteer/puppeteer/issues)
before
[filing an issue](https://github.com/puppeteer/puppeteer/issues/new/choose).

## Debugging methods for all situations

These methods can be used to debug any situation. These should be used as a
quick sanity check before diving into more complex methods.

### Turn off [`headless`](../api/puppeteer.launchoptions)

Sometimes it's useful to see what the browser is displaying. Instead of
launching in
[`headless`](../api/puppeteer.launchoptions) mode,
launch a full version of the browser with
[`headless`](../api/puppeteer.launchoptions) set to
`false`:

```ts
const browser = await puppeteer.launch({headless: false});
```

### Puppeteer "slow-mo"

The [`slowMo`](../api/puppeteer.connectoptions) option slows down
Puppeteer operations by a specified amount of milliseconds. It's another way to
help see what's going on.

```ts
const browser = await puppeteer.launch({
  headless: false,
  slowMo: 250, // slow down by 250ms
});
```

## Debugging methods for client code

### Capture `console.*` output

Since client code runs in the browser, doing `console.*` in client code will not
directly log to Node.js. However, you can [listen (page.on)](../api/puppeteer.page) for
the [`console`](../api/puppeteer.pageevents) event which returns a
payload with the logged text.

```ts
page.on('console', msg => console.log('PAGE LOG:', msg.text()));

await page.evaluate(() => console.log(`url is ${location.href}`));
```

### Use the debugger in the browser

1. Set [`devtools`](../api/puppeteer.launchoptions) to
   `true` when launching Puppeteer:

   ```ts
   const browser = await puppeteer.launch({devtools: true});
   ```

2. Add `debugger` inside any client code you want debugged. For example,

   ```ts
   await page.evaluate(() => {
     debugger;
   });
   ```

   The Browser will now stop in the location the `debugger` word is found in
   debug mode.

## Debugging methods for server code

### Use the debugger in Node.js (Chrome/Chromium-only)

Since server code intermingles with client code, this method of debugging is
closely tied with the browser. For example, you can step over
`await page.click()` in the server script and see the click happen in the
browser.

Note that you won't be able to run `await page.click()` in DevTools console due
to this
[Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=833928), so
if you want to try something out, you have to add it to your test file.

1. Set [`headless`](../api/puppeteer.launchoptions) to
   `false`.
2. Add `debugger` to any server code you want debugged. For example,

   ```ts
   debugger;
   await page.click('a[target=_blank]');
   ```

3. Run your server code with `--inspect-brk`. For example,

   ```bash
   node --inspect-brk path/to/script.js
   ```

4. In the opened Chrome/Chromium browser, open `chrome://inspect/#devices` and
   click `inspect`.
5. In the newly opened test browser, press `F8` to resume test execution.
6. Now your `debugger` statement will be hit and you can debug in the test
   browser.

### Log DevTools protocol traffic

If all else fails, it's possible there may be an issue between Puppeteer and the
DevTools protocol. You can debug this by setting the `DEBUG` environment
variable before running your script. This will log internal traffic via
[`debug`](https://github.com/visionmedia/debug) under the `puppeteer` namespace.

:::warning

The logs may include sensitive information.

:::

```bash
# Basic verbose logging
env DEBUG="puppeteer:*" node script.js

# Prevent truncating of long messages
env DEBUG="puppeteer:*" env DEBUG_MAX_STRING_LENGTH=null node script.js

# Protocol traffic can be rather noisy. This example filters out all Network domain messages
env DEBUG="puppeteer:*" env DEBUG_COLORS=true node script.js 2>&1 | grep -v '"Network'

# Filter out all protocol messages but keep all other logging
env DEBUG="puppeteer:*,-puppeteer:protocol:*" node script.js
```

### Log pending protocol calls

If you encounter issues with async Puppeteer calls not getting resolved, try logging
pending callbacks by using the [`debugInfo`](https://pptr.dev/api/puppeteer.browser/#properties) interface
to see what call is the cause:

```ts
console.log(browser.debugInfo.pendingProtocolErrors);
```

The getter returns a list of `Error` objects and the stacktraces of the error objects
indicate which code triggered a protocol call.

## Debugging methods for the browser code

### Print browser logs

If the browser unexpectedly crashes or does not launch properly, it could be useful
to inspect logs from the browser process by setting the launch attribute `dumpio` to `true`.

```ts
const browser = await puppeteer.launch({
  dumpio: true,
});
```

In this case, Puppeteer forwards browser logs to the Node process' stdio.

    # Docker

Puppeteer offers a Docker image that includes [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) along with the required
dependencies and a pre-installed Puppeteer version. The image is available via
the
[GitHub Container Registry](https://github.com/puppeteer/puppeteer/pkgs/container/puppeteer).
The latest image is tagged as `latest` and other tags match Puppeteer versions.
For example,

```bash
docker pull ghcr.io/puppeteer/puppeteer:latest # pulls the latest
docker pull ghcr.io/puppeteer/puppeteer:16.1.0 # pulls the image that contains Puppeteer v16.1.0
```

The image is meant for running the browser in sandbox mode and therefore,
running the image requires the `SYS_ADMIN` capability.

## Usage

To use the docker image directly, run:

```bash
docker run -i --init --cap-add=SYS_ADMIN --rm ghcr.io/puppeteer/puppeteer:latest node -e "$(cat path/to/script.js)"
```

where `path/to/script.js` is the path relative to your working directory. Note
the image requires the `SYS_ADMIN` capability since the browser runs in sandbox
mode.

If you need to build an image based on a different base image, you can use our
[`Dockerfile`](https://github.com/puppeteer/puppeteer/blob/main/docker/Dockerfile)
as the starting point.

:::caution

Make sure to specify a init process via the `--init` flag or a custom `ENTRYPOINT`
to make sure all processes started by Puppeteer are managed properly.

:::

## dbus

The image installs and configures dbus for Chrome. Usually you would not
need dbus in the headless mode but you might see warnings in the browser
console. You can start the dbus service before launching
your application:

```
sudo service dbus start
```

See https://docs.docker.com/config/containers/multi-service_container/
for instructions how to start multiple processes in a container.

    # Files

Currently, Puppeteer does not offer a way to handle file downloads in a programmatic way.
For uploading files, you need to locate a file input element and call [`ElementHandle.uploadFile`](https://pptr.dev/api/puppeteer.elementhandle.uploadfile/).

```ts
const fileElement = await page.waitForSelector('input[type=file]');
await fileElement.uploadFile(['./path-to-local-file']);
```

    # Getting started

Puppeteer will be familiar to people using other browser testing frameworks. You
[launch](https://pptr.dev/api/puppeteer.puppeteernode.launch)/[connect](https://pptr.dev/api/puppeteer.puppeteernode.connect)
a [browser](https://pptr.dev/api/puppeteer.browser),
[create](https://pptr.dev/api/puppeteer.browser.newpage) some
[pages](https://pptr.dev/api/puppeteer.page), and then manipulate them with
[Puppeteer's API](https://pptr.dev/api).

The following example searches [developer.chrome.com](https://developer.chrome.com/) for blog posts with text "automate beyond recorder", click on the first result and print the full title of the blog post.

```ts
import puppeteer from 'puppeteer';

(async () => {
  // Launch the browser and open a new blank page
  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  // Navigate the page to a URL
  await page.goto('https://developer.chrome.com/');

  // Set screen size
  await page.setViewport({width: 1080, height: 1024});

  // Type into search box
  await page.type('.devsite-search-field', 'automate beyond recorder');

  // Wait and click on first result
  const searchResultSelector = '.devsite-result-item-link';
  await page.waitForSelector(searchResultSelector);
  await page.click(searchResultSelector);

  // Locate the full title with a unique string
  const textSelector = await page.waitForSelector(
    'text/Customize and automate',
  );
  const fullTitle = await textSelector?.evaluate(el => el.textContent);

  // Print the full title
  console.log('The title of this blog post is "%s".', fullTitle);

  await browser.close();
})();
```

For more in-depth usage, check our [documentation](https://pptr.dev/docs)
and [examples](https://github.com/puppeteer/puppeteer/tree/main/examples).

    # Headless mode

By default Puppeteer launches the browser in
[the Headless mode](https://developer.chrome.com/docs/chromium/new-headless/).

```ts
const browser = await puppeteer.launch();
// Equivalent to
const browser = await puppeteer.launch({headless: true});
```

Before v22, Puppeteer launched the [old Headless mode](https://developer.chrome.com/docs/chromium/new-headless/) by default.
The old headless mode is now known as
[`chrome-headless-shell`](https://developer.chrome.com/blog/chrome-headless-shell)
and ships as a separate binary. `chrome-headless-shell` does not match the
behavior of the regular Chrome completely but it is currently more performant
for automation tasks where the complete Chrome feature set is not needed. If the performance
is more important for your use case, switch to `chrome-headless-shell` as following:

```ts
const browser = await puppeteer.launch({headless: 'shell'});
```

To launch a "headful" version of Chrome, set the
[`headless`](https://pptr.dev/api/puppeteer.launchoptions) to `false`
option when launching a browser:

```ts
const browser = await puppeteer.launch({headless: false});
```

    # Installation

To use Puppeteer in your project, run:

```bash npm2yarn
npm i puppeteer
```

When you install Puppeteer, it automatically downloads a recent version of
[Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) (~170MB macOS, ~282MB Linux, ~280MB Windows) and a `chrome-headless-shell` binary (starting with Puppeteer v21.6.0) that is [guaranteed to
work](https://pptr.dev/faq#q-why-doesnt-puppeteer-vxxx-work-with-a-certain-version-of-chrome-or-firefox)
with Puppeteer. The browser is downloaded to the `$HOME/.cache/puppeteer` folder
by default (starting with Puppeteer v19.0.0). See [configuration](https://pptr.dev/api/puppeteer.configuration) for configuration options and environmental variables to control the download behavior.

For every release since v1.7.0 we publish two packages:

- [`puppeteer`](https://www.npmjs.com/package/puppeteer)
- [`puppeteer-core`](https://www.npmjs.com/package/puppeteer-core)

`puppeteer` is a _product_ for browser automation. When installed, it downloads
a version of Chrome, which it then drives using `puppeteer-core`. Being an
end-user product, `puppeteer` automates several workflows using reasonable
defaults [that can be customized](https://pptr.dev/guides/configuration).

`puppeteer-core` is a _library_ to help drive anything that supports DevTools
protocol. Being a library, `puppeteer-core` is fully driven through its
programmatic interface implying no defaults are assumed and `puppeteer-core`
will not download Chrome when installed.

You should use `puppeteer-core` if you are
[connecting to a remote browser](https://pptr.dev/api/puppeteer.puppeteer.connect)
or [managing browsers yourself](https://pptr.dev/browsers-api/).
If you are managing browsers yourself, you will need to call
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch) with
an explicit
[`executablePath`](https://pptr.dev/api/puppeteer.launchoptions)
(or [`channel`](https://pptr.dev/api/puppeteer.launchoptions) if it's
installed in a standard location).

When using `puppeteer-core`, remember to change the import:

```ts
import puppeteer from 'puppeteer-core';
```

    # JavaScript execution

Puppeteer allows evaluating JavaScript functions in the context of the page
driven by Puppeteer:

```ts
// Import puppeteer
import puppeteer from 'puppeteer';

(async () => {
  // Launch the browser
  const browser = await puppeteer.launch();

  // Create a page
  const page = await browser.newPage();

  // Go to your site
  await page.goto('YOUR_SITE');

  // Evaluate JavaScript
  const three = await page.evaluate(() => {
    return 1 + 2;
  });

  console.log(three);

  // Close browser.
  await browser.close();
})();
```

:::caution

Although the function is defined in your script context, it actually gets
converted to a string by Puppeteer, sent to the target page and evaluated there.
It means that the function cannot access scope variables or call other functions
defined in your Puppeteer script, and you need to define the entire function
logic within the function body.

:::

Alternatively, you can provide a function body as a string:

```ts
// Evaluate JavaScript
const three = await page.evaluate(`
    1 + 2
`);
```

:::caution

The example above produces the equivalent results but it also illustrates that
the types and global variables available to the evaluated function cannot be
known. Especially, in TypeScript you should be careful to make sure that objects
referenced by the evaluated function are correct.

:::

## Return types

The functions you evaluate can return values. If the returned value is of a
primitive type, it gets automatically converted by Puppeteer to a primitive type
in the script context like in the previous example.

If the script returns an object, Puppeteer serializes it to a JSON and
reconstructs it on the script side. This process might not always yield correct
results, for example, when you return a DOM node:

```ts
const body = await page.evaluate(() => {
  return document.body;
});
console.log(body); // {}, unexpected!
```

To work with the returned objects, Puppeteer offers a way to return objects by reference:

```ts
const body = await page.evaluateHandle(() => {
  return document.body;
});
console.log(body instanceof ElementHandle); // true
```

The returned object is either a `JSHandle` or a `ElementHandle`. `ElementHandle`
extends `JSHandle` and it is only created for DOM elements.

See the [API documentation](https://pptr.dev/api) for more details about what methods are available for handles.

## Returning promises

If you return a Promise from an evaluate call, the promise will be automatically
awaited. For example,

```ts
await page.evaluate(() => {
  // wait for 100ms.
  return new Promise(resolve => setTimeout(resolve, 100));
});
// Execution continues here once the Promise created in the page context resolves.
```

## Passing arguments to the evaluate function

You can provide arguments to your function:

```ts
const three = await page.evaluate(
  (a, b) => {
    return a + b; // 1 + 2
  },
  1,
  2,
);
```

The arguments can be primitive values or `JSHandle`s.

:::note

Page, JSHandle and ElementHandle offer several different helpers to evaluate
JavaScript but they all follow the basic principles outlined in this guide.

:::

    # Links

- [API Documentation](https://pptr.dev/api)
- [Guides](https://pptr.dev/category/guides)
- [Examples](https://github.com/puppeteer/puppeteer/tree/main/examples)
- [Community list of Puppeteer resources](https://github.com/transitive-bullshit/awesome-puppeteer)

    # Request Interception

Once request interception is enabled, every request will stall unless it's
continued, responded or aborted.

An example of a naïve request interceptor that aborts all image requests:

```ts
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setRequestInterception(true);
  page.on('request', interceptedRequest => {
    if (interceptedRequest.isInterceptResolutionHandled()) return;
    if (
      interceptedRequest.url().endsWith('.png') ||
      interceptedRequest.url().endsWith('.jpg')
    )
      interceptedRequest.abort();
    else interceptedRequest.continue();
  });
  await page.goto('https://example.com');
  await browser.close();
})();
```

## Multiple Intercept Handlers and Asynchronous Resolutions

By default Puppeteer will raise a `Request is already handled!` exception if
`request.abort`, `request.continue`, or `request.respond` are called after any
of them have already been called.

Always assume that an unknown handler may have already called
`abort/continue/respond`. Even if your handler is the only one you registered,
3rd party packages may register their own handlers. It is therefore important to
always check the resolution status using
[request.isInterceptResolutionHandled](../api/puppeteer.httprequest.isinterceptresolutionhandled)
before calling `abort/continue/respond`.

Importantly, the intercept resolution may get handled by another listener while
your handler is awaiting an asynchronous operation. Therefore, the return value
of `request.isInterceptResolutionHandled` is only safe in a synchronous code
block. Always execute `request.isInterceptResolutionHandled` and
`abort/continue/respond` **synchronously** together.

This example demonstrates two synchronous handlers working together:

```ts
/*
This first handler will succeed in calling request.continue because the request interception has never been resolved.
*/
page.on('request', interceptedRequest => {
  if (interceptedRequest.isInterceptResolutionHandled()) return;
  interceptedRequest.continue();
});

/*
This second handler will return before calling request.abort because request.continue was already
called by the first handler.
*/
page.on('request', interceptedRequest => {
  if (interceptedRequest.isInterceptResolutionHandled()) return;
  interceptedRequest.abort();
});
```

This example demonstrates asynchronous handlers working together:

```ts
/*
This first handler will succeed in calling request.continue because the request interception has never been resolved.
*/
page.on('request', interceptedRequest => {
  // The interception has not been handled yet. Control will pass through this guard.
  if (interceptedRequest.isInterceptResolutionHandled()) return;

  // It is not strictly necessary to return a promise, but doing so will allow Puppeteer to await this handler.
  return new Promise(resolve => {
    // Continue after 500ms
    setTimeout(() => {
      // Inside, check synchronously to verify that the intercept wasn't handled already.
      // It might have been handled during the 500ms while the other handler awaited an async op of its own.
      if (interceptedRequest.isInterceptResolutionHandled()) {
        resolve();
        return;
      }
      interceptedRequest.continue();
      resolve();
    }, 500);
  });
});
page.on('request', async interceptedRequest => {
  // The interception has not been handled yet. Control will pass through this guard.
  if (interceptedRequest.isInterceptResolutionHandled()) return;

  await someLongAsyncOperation();
  // The interception *MIGHT* have been handled by the first handler, we can't be sure.
  // Therefore, we must check again before calling continue() or we risk Puppeteer raising an exception.
  if (interceptedRequest.isInterceptResolutionHandled()) return;
  interceptedRequest.continue();
});
```

For finer-grained introspection (see Cooperative Intercept Mode below), you may
also call
[request.interceptResolutionState](../api/puppeteer.httprequest.interceptresolutionstate)
synchronously before using `abort/continue/respond`.

Here is the example above rewritten using `request.interceptResolutionState`

```ts
/*
This first handler will succeed in calling request.continue because the request interception has never been resolved.
*/
page.on('request', interceptedRequest => {
  // The interception has not been handled yet. Control will pass through this guard.
  const {action} = interceptedRequest.interceptResolutionState();
  if (action === InterceptResolutionAction.AlreadyHandled) return;

  // It is not strictly necessary to return a promise, but doing so will allow Puppeteer to await this handler.
  return new Promise(resolve => {
    // Continue after 500ms
    setTimeout(() => {
      // Inside, check synchronously to verify that the intercept wasn't handled already.
      // It might have been handled during the 500ms while the other handler awaited an async op of its own.
      const {action} = interceptedRequest.interceptResolutionState();
      if (action === InterceptResolutionAction.AlreadyHandled) {
        resolve();
        return;
      }
      interceptedRequest.continue();
      resolve();
    }, 500);
  });
});
page.on('request', async interceptedRequest => {
  // The interception has not been handled yet. Control will pass through this guard.
  if (
    interceptedRequest.interceptResolutionState().action ===
    InterceptResolutionAction.AlreadyHandled
  )
    return;

  await someLongAsyncOperation();
  // The interception *MIGHT* have been handled by the first handler, we can't be sure.
  // Therefore, we must check again before calling continue() or we risk Puppeteer raising an exception.
  if (
    interceptedRequest.interceptResolutionState().action ===
    InterceptResolutionAction.AlreadyHandled
  )
    return;
  interceptedRequest.continue();
});
```

## Cooperative Intercept Mode

`request.abort`, `request.continue`, and `request.respond` can accept an
optional `priority` to work in Cooperative Intercept Mode. When all handlers are
using Cooperative Intercept Mode, Puppeteer guarantees that all intercept
handlers will run and be awaited in order of registration. The interception is
resolved to the highest-priority resolution. Here are the rules of Cooperative
Intercept Mode:

- All resolutions must supply a numeric `priority` argument to
  `abort/continue/respond`.
- If any resolution does not supply a numeric `priority`, Legacy Mode is active
  and Cooperative Intercept Mode is inactive.
- Async handlers finish before intercept resolution is finalized.
- The highest priority interception resolution "wins", i.e. the interception is
  ultimately aborted/responded/continued according to which resolution was given
  the highest priority.
- In the event of a tie, `abort` > `respond` > `continue`.

For standardization, when specifying a Cooperative Intercept Mode priority use
`0` or `DEFAULT_INTERCEPT_RESOLUTION_PRIORITY` (exported from `HTTPRequest`)
unless you have a clear reason to use a higher priority. This gracefully prefers
`respond` over `continue` and `abort` over `respond` and allows other handlers
to work cooperatively. If you do intentionally want to use a different priority,
higher priorities win over lower priorities. Negative priorities are allowed.
For example, `continue({}, 4)` would win over `continue({}, -2)`.

To preserve backward compatibility, any handler resolving the intercept without
specifying `priority` (Legacy Mode) causes immediate resolution. For Cooperative
Intercept Mode to work, all resolutions must use a `priority`. In practice, this
means you must still test for `request.isInterceptResolutionHandled` because a
handler beyond your control may have called `abort/continue/respond` without a
priority (Legacy Mode).

In this example, Legacy Mode prevails and the request is aborted immediately
because at least one handler omits `priority` when resolving the intercept:

```ts
// Final outcome: immediate abort()
page.setRequestInterception(true);
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Legacy Mode: interception is aborted immediately.
  request.abort('failed');
});
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;
  // Control will never reach this point because the request was already aborted in Legacy Mode

  // Cooperative Intercept Mode: votes for continue at priority 0.
  request.continue({}, 0);
});
```

In this example, Legacy Mode prevails and the request is continued because at
least one handler does not specify a `priority`:

```ts
// Final outcome: immediate continue()
page.setRequestInterception(true);
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Cooperative Intercept Mode: votes to abort at priority 0.
  request.abort('failed', 0);
});
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Control reaches this point because the request was cooperatively aborted which postpones resolution.

  // { action: InterceptResolutionAction.Abort, priority: 0 }, because abort @ 0 is the current winning resolution
  console.log(request.interceptResolutionState());

  // Legacy Mode: intercept continues immediately.
  request.continue({});
});
page.on('request', request => {
  // { action: InterceptResolutionAction.AlreadyHandled }, because continue in Legacy Mode was called
  console.log(request.interceptResolutionState());
});
```

In this example, Cooperative Intercept Mode is active because all handlers
specify a `priority`. `continue()` wins because it has a higher priority than
`abort()`.

```ts
// Final outcome: cooperative continue() @ 5
page.setRequestInterception(true);
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Cooperative Intercept Mode: votes to abort at priority 10
  request.abort('failed', 0);
});
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Cooperative Intercept Mode: votes to continue at priority 5
  request.continue(request.continueRequestOverrides(), 5);
});
page.on('request', request => {
  // { action: InterceptResolutionAction.Continue, priority: 5 }, because continue @ 5 > abort @ 0
  console.log(request.interceptResolutionState());
});
```

In this example, Cooperative Intercept Mode is active because all handlers
specify `priority`. `respond()` wins because its priority ties with
`continue()`, but `respond()` beats `continue()`.

```ts
// Final outcome: cooperative respond() @ 15
page.setRequestInterception(true);
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Cooperative Intercept Mode: votes to abort at priority 10
  request.abort('failed', 10);
});
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Cooperative Intercept Mode: votes to continue at priority 15
  request.continue(request.continueRequestOverrides(), 15);
});
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Cooperative Intercept Mode: votes to respond at priority 15
  request.respond(request.responseForRequest(), 15);
});
page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  // Cooperative Intercept Mode: votes to respond at priority 12
  request.respond(request.responseForRequest(), 12);
});
page.on('request', request => {
  // { action: InterceptResolutionAction.Respond, priority: 15 }, because respond @ 15 > continue @ 15 > respond @ 12 > abort @ 10
  console.log(request.interceptResolutionState());
});
```

## Cooperative Request Continuation

Puppeteer requires `request.continue()` to be called explicitly or the request
will hang. Even if your handler means to take no special action, or 'opt out',
`request.continue()` must still be called.

With the introduction of Cooperative Intercept Mode, two use cases arise for
cooperative request continuations: Unopinionated and Opinionated.

The first case (common) is that your handler means to opt out of doing anything
special the request. It has no opinion on further action and simply intends to
continue by default and/or defer to other handlers that might have an opinion.
But in case there are no other handlers, we must call `request.continue()` to
ensure that the request doesn't hang.

We call this an **Unopinionated continuation** because the intent is to continue
the request if nobody else has a better idea. Use
`request.continue({...}, DEFAULT_INTERCEPT_RESOLUTION_PRIORITY)` (or `0`) for
this type of continuation.

The second case (uncommon) is that your handler actually does have an opinion
and means to force continuation by overriding a lower-priority `abort()` or
`respond()` issued elsewhere. We call this an **Opinionated continuation**. In
these rare cases where you mean to specify an overriding continuation priority,
use a custom priority.

To summarize, reason through whether your use of `request.continue` is just
meant to be default/bypass behavior vs falling within the intended use case of
your handler. Consider using a custom priority for in-scope use cases, and a
default priority otherwise. Be aware that your handler may have both Opinionated
and Unopinionated cases.

## Upgrading to Cooperative Intercept Mode for package maintainers

If you are package maintainer and your package uses intercept handlers, you can
update your intercept handlers to use Cooperative Intercept Mode. Suppose you
have the following existing handler:

```ts
page.on('request', interceptedRequest => {
  if (request.isInterceptResolutionHandled()) return;
  if (
    interceptedRequest.url().endsWith('.png') ||
    interceptedRequest.url().endsWith('.jpg')
  )
    interceptedRequest.abort();
  else interceptedRequest.continue();
});
```

To use Cooperative Intercept Mode, upgrade `continue()` and `abort()`:

```ts
page.on('request', interceptedRequest => {
  if (request.isInterceptResolutionHandled()) return;
  if (
    interceptedRequest.url().endsWith('.png') ||
    interceptedRequest.url().endsWith('.jpg')
  )
    interceptedRequest.abort('failed', 0);
  else
    interceptedRequest.continue(
      interceptedRequest.continueRequestOverrides(),
      0,
    );
});
```

With those simple upgrades, your handler now uses Cooperative Intercept Mode
instead.

However, we recommend a slightly more robust solution because the above
introduces several subtle issues:

1. **Backward compatibility.** If any handler still uses a Legacy Mode
   resolution (ie, does not specify a priority), that handler will resolve the
   interception immediately even if your handler runs first. This could cause
   disconcerting behavior for your users because suddenly your handler is not
   resolving the interception and a different handler is taking priority when
   all the user did was upgrade your package.
2. **Hard-coded priority.** Your package user has no ability to specify the
   default resolution priority for your handlers. This can become important when
   the user wishes to manipulate the priorities based on use case. For example,
   one user might want your package to take a high priority while another user
   might want it to take a low priority.

To resolve both of these issues, our recommended approach is to export a
`setInterceptResolutionConfig()` from your package. The user can then call
`setInterceptResolutionConfig()` to explicitly activate Cooperative Intercept
Mode in your package so they aren't surprised by changes in how the interception
is resolved. They can also optionally specify a custom priority using
`setInterceptResolutionConfig(priority)` that works for their use case:

```ts
// Defaults to undefined which preserves Legacy Mode behavior
let _priority = undefined;

// Export a module configuration function
export const setInterceptResolutionConfig = (priority = 0) =>
  (_priority = priority);

/**
 * Note that this handler uses `DEFAULT_INTERCEPT_RESOLUTION_PRIORITY` to "pass" on this request. It is important to use
 * the default priority when your handler has no opinion on the request and the intent is to continue() by default.
 */
page.on('request', interceptedRequest => {
  if (request.isInterceptResolutionHandled()) return;
  if (
    interceptedRequest.url().endsWith('.png') ||
    interceptedRequest.url().endsWith('.jpg')
  )
    interceptedRequest.abort('failed', _priority);
  else
    interceptedRequest.continue(
      interceptedRequest.continueRequestOverrides(),
      DEFAULT_INTERCEPT_RESOLUTION_PRIORITY, // Unopinionated continuation
    );
});
```

If your package calls for more fine-grained control over resolution priorities,
use a config pattern like this:

```ts
interface InterceptResolutionConfig {
  abortPriority?: number;
  continuePriority?: number;
}

// This approach supports multiple priorities based on situational
// differences. You could, for example, create a config that
// allowed separate priorities for PNG vs JPG.
const DEFAULT_CONFIG: InterceptResolutionConfig = {
  abortPriority: undefined, // Default to Legacy Mode
  continuePriority: undefined, // Default to Legacy Mode
};

// Defaults to undefined which preserves Legacy Mode behavior
let _config: Partial<InterceptResolutionConfig> = {};

export const setInterceptResolutionConfig = (
  config: InterceptResolutionConfig,
) => (_config = {...DEFAULT_CONFIG, ...config});

page.on('request', interceptedRequest => {
  if (request.isInterceptResolutionHandled()) return;
  if (
    interceptedRequest.url().endsWith('.png') ||
    interceptedRequest.url().endsWith('.jpg')
  ) {
    interceptedRequest.abort('failed', _config.abortPriority);
  } else {
    // Here we use a custom-configured priority to allow for Opinionated
    // continuation.
    // We would only want to allow this if we had a very clear reason why
    // some use cases required Opinionated continuation.
    interceptedRequest.continue(
      interceptedRequest.continueRequestOverrides(),
      _config.continuePriority, // Why would we ever want priority!==0 here?
    );
  }
});
```

The above solutions ensure backward compatibility while also allowing the user
to adjust the importance of your package in the resolution chain when
Cooperative Intercept Mode is being used. Your package continues to work as
expected until the user has fully upgraded their code and all third party
packages to use Cooperative Intercept Mode. If any handler or package still uses
Legacy Mode, your package can still operate in Legacy Mode too.

    # Network logging

By default, Puppeteer listens for all network requests and responses and emits network events on the page.

```ts
const page = await browser.newPage();
page.on('request', request => {
  console.log(request.url());
});

page.on('response', response => {
  console.log(response.url());
});
```

    # Puppeteer Angular Schematic

Adds Puppeteer-based e2e tests to your Angular project.

## Getting started

Run the command below in an Angular CLI app directory and follow the prompts.

> Note this will add the schematic as a dependency to your project.

```bash
ng add @puppeteer/ng-schematics
```

Or you can use the same command followed by the [options](#options) below.

Currently, this schematic supports the following test runners:

- [**Jasmine**](https://jasmine.github.io/)
- [**Jest**](https://jestjs.io/)
- [**Mocha**](https://mochajs.org/)
- [**Node Test Runner**](https://nodejs.org/api/test.html)

With the schematics installed you can run E2E tests:

```bash
ng e2e
```

### Options

When adding schematics to your project you can to provide following options:

| Option          | Description                                            | Value                                      | Required |
| --------------- | ------------------------------------------------------ | ------------------------------------------ | -------- |
| `--test-runner` | The testing framework to install along side Puppeteer. | `"jasmine"`, `"jest"`, `"mocha"`, `"node"` | `true`   |

## Creating a single test file

Puppeteer Angular Schematic exposes a method to create a single test file.

```bash
ng generate @puppeteer/ng-schematics:e2e "<TestName>"
```

### Running test server and dev server at the same time

By default the E2E test will run the app on the same port as `ng start`.
To avoid this you can specify the port in the `angular.json`
Update either `e2e` or `puppeteer` (depending on the initial setup) to:

```json
{
  "e2e": {
    "builder": "@puppeteer/ng-schematics:puppeteer",
    "options": {
      "commands": [...],
      "devServerTarget": "sandbox:serve",
      "testRunner": "<TestRunner>",
      "port": 8080
    },
    ...
}
```

Now update the E2E test file `utils.ts` baseUrl to:

```ts
const baseUrl = 'http://localhost:8080';
```

## Contributing

Check out our [contributing guide](https://pptr.dev/contributing) to get an overview of what you need to develop in the Puppeteer repo.

### Sandbox smoke tests

To make integration easier smoke test can be run with a single command, that will create a fresh install of Angular (single application and a multi application projects). Then it will install the schematics inside them and run the initial e2e tests:

```bash
node tools/smoke.mjs
```

### Unit Testing

The schematics utilize `@angular-devkit/schematics/testing` for verifying correct file creation and `package.json` updates. To execute the test suit:

```bash npm2yarn
npm run test
```

## Migrating from Protractor

### Entry point

Puppeteer has its own [`browser`](https://pptr.dev/api/puppeteer.browser) that exposes the browser process.
A more close comparison for Protractor's `browser` would be Puppeteer's [`page`](https://pptr.dev/api/puppeteer.page).

```ts
// Testing framework specific imports

import {setupBrowserHooks, getBrowserState} from './utils';

describe('<Test Name>', function () {
  setupBrowserHooks();
  it('is running', async function () {
    const {page} = getBrowserState();
    // Query elements
    await page
      .locator('my-component')
      // Click on the element once found
      .click();
  });
});
```

### Getting element properties

You can easily get any property of the element.

```ts
// Testing framework specific imports

import {setupBrowserHooks, getBrowserState} from './utils';

describe('<Test Name>', function () {
  setupBrowserHooks();
  it('is running', async function () {
    const {page} = getBrowserState();
    // Query elements
    const elementText = await page
      .locator('.my-component')
      .map(button => button.innerText)
      // Wait for element to show up
      .wait();

    // Assert via assertion library
  });
});
```

### Query Selectors

Puppeteer supports multiple types of selectors, namely, the CSS, ARIA, text, XPath and pierce selectors.
The following table shows Puppeteer's equivalents to [Protractor By](https://www.protractortest.org/#/api?view=ProtractorBy).

> For improved reliability and reduced flakiness try our
> **Experimental** [Locators API](https://pptr.dev/guides/page-interactions#locators)

| By                | Protractor code                               | Puppeteer querySelector                                      |
| ----------------- | --------------------------------------------- | ------------------------------------------------------------ |
| CSS (Single)      | `$(by.css('<CSS>'))`                          | `page.$('<CSS>')`                                            |
| CSS (Multiple)    | `$$(by.css('<CSS>'))`                         | `page.$$('<CSS>')`                                           |
| Id                | `$(by.id('<ID>'))`                            | `page.$('#<ID>')`                                            |
| CssContainingText | `$(by.cssContainingText('<CSS>', '<TEXT>'))`  | `page.$('<CSS> ::-p-text(<TEXT>)')` `                        |
| DeepCss           | `$(by.deepCss('<CSS>'))`                      | `page.$(':scope >>> <CSS>')`                                 |
| XPath             | `$(by.xpath('<XPATH>'))`                      | `page.$('::-p-xpath(<XPATH>)')`                              |
| JS                | `$(by.js('document.querySelector("<CSS>")'))` | `page.evaluateHandle(() => document.querySelector('<CSS>'))` |

> For advanced use cases such as Protractor's `by.addLocator` you can check Puppeteer's [Custom selectors](https://pptr.dev/guides/query-selectors#custom-selectors).

### Actions Selectors

Puppeteer allows you to all necessary actions to allow test your application.

```ts
// Click on the element.
element(locator).click();
// Puppeteer equivalent
await page.locator(locator).click();

// Send keys to the element (usually an input).
element(locator).sendKeys('my text');
// Puppeteer equivalent
await page.locator(locator).fill('my text');

// Clear the text in an element (usually an input).
element(locator).clear();
// Puppeteer equivalent
await page.locator(locator).fill('');

// Get the value of an attribute, for example, get the value of an input.
element(locator).getAttribute('value');
// Puppeteer equivalent
const element = await page.locator(locator).waitHandle();
const value = await element.getProperty('value');
```

### Example

Sample Protractor test:

```ts
describe('Protractor Demo', function () {
  it('should add one and two', function () {
    browser.get('https://juliemr.github.io/protractor-demo/');
    element(by.model('first')).sendKeys(1);
    element(by.model('second')).sendKeys(2);

    element(by.id('gobutton')).click();

    expect(element(by.binding('latest')).getText()).toEqual('3');
  });
});
```

Sample Puppeteer migration:

```ts
import {setupBrowserHooks, getBrowserState} from './utils';

describe('Puppeteer Demo', function () {
  setupBrowserHooks();
  it('should add one and two', function () {
    const {page} = getBrowserState();
    await page.goto('https://juliemr.github.io/protractor-demo/');

    await page.locator('.form-inline > input:nth-child(1)').fill('1');
    await page.locator('.form-inline > input:nth-child(2)').fill('2');
    await page.locator('#gobutton').fill('2');

    const result = await page
      .locator('.table tbody td:last-of-type')
      .map(header => header.innerText)
      .wait();

    expect(result).toEqual('3');
  });
});
```

    # Page interactions

Puppeteer allows interacting with elements on the page through mouse, touch
events and keyboard input. Usually you first query a DOM element using a [CSS
selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors) and
then invoke an action on the selected element. All of Puppeteer APIs that accept
a selector, accept a [CSS
selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors) by
default. Additionally, Puppeteer offers [custom selector syntax](#selectors) that allows
finding elements using XPath, Text, Accessibility attributes and accessing
Shadow DOM without the need to execute JavaScript.

If you want to emit mouse or
keyboard events without selecting an element first, use the
[`page.mouse`](https://pptr.dev/api/puppeteer.mouse),
[`page.keyboard`](https://pptr.dev/api/puppeteer.keyboard) and
[`page.touchscreen`](https://pptr.dev/api/puppeteer.touchscreen) APIs. The rest
of this guide, gives an overview on how to select DOM elements and invoke
actions on them.

## Locators

Locators is the recommended way to select an element and interact with it.
Locators encapsulate the information on how to select an element and they allow
Puppeteer to automatically wait for the element to be present in the DOM and to
be in the right state for the action. You always instantiate a locator using the
[`page.locator()`](https://pptr.dev/api/puppeteer.page.locator) or
[`frame.locator()`](https://pptr.dev/api/puppeteer.frame.locator) function. If
the locator API doesn't offer a functionality you need, you can still use lower
level APIs such as
[`page.waitForSelector()`](https://pptr.dev/api/puppeteer.page.waitforselector/)
or [`ElementHandle`](https://pptr.dev/api/puppeteer.elementhandle/).

### Clicking an element using locators

```ts
// 'button' is a CSS selector.
await page.locator('button').click();
```

The locator automatically checks the following before clicking:

- Ensures the element is in the viewport.
- Waits for the element to become
  [visible](https://pptr.dev/api/puppeteer.elementhandle.isvisible/) or hidden.
- Waits for the element to become enabled.
- Waits for the element to have a stable bounding box over two consecutive
  animation frames.

### Filling out an input

```ts
// 'input' is a CSS selector.
await page.locator('input').fill('value');
```

Automatically detects the input type and choose an appropriate way to fill it
out with the provided value. For example, it will fill out `<select>` elements as
well as `<input>` elements.

The locator automatically checks the following before typing into the input:

- Ensures the element is in the viewport.
- Waits for the element to become
  [visible](https://pptr.dev/api/puppeteer.elementhandle.isvisible/) or hidden.
- Waits for the element to become enabled.
- Waits for the element to have a stable bounding box over two consecutive
  animation frames.

#### Hover over an element

```ts
await page.locator('div').hover();
```

The locator automatically checks the following before hovering:

- Ensures the element is in the viewport.
- Waits for the element to become
  [visible](https://pptr.dev/api/puppeteer.elementhandle.isvisible/) or hidden.
- Waits for the element to have a stable bounding box over two consecutive
  animation frames.

#### Scroll an element

The [`.scroll()`] functions uses mouse wheel events to scroll an element.

```ts
// Scroll the div element by 10px horizontally
// and by 20 px vertically.
await page.locator('div').scroll({
  scrollLeft: 10,
  scrollTop: 20,
});
```

The locator automatically checks the following before scrolling:

- Ensures the element is in the viewport.
- Waits for the element to become
  [visible](https://pptr.dev/api/puppeteer.elementhandle.isvisible/) or hidden.
- Waits for the element to have a stable bounding box over two consecutive
  animation frames.

### Waiting for element to be visible

Sometimes you only need to wait for the element to be visible.

```ts
// '.loading' is a CSS selector.
await page.locator('.loading').wait();
```

The locator automatically checks the following before returning:

- Waits for the element to become
  [visible](https://pptr.dev/api/puppeteer.elementhandle.isvisible/) or hidden.

### Waiting for a function

Sometimes it is useful to wait for an arbitrary condition expressed as a
JavaScript function. In this case, locator can be defined using a function
instead of a selector. The following example waits until the MutationObserver
detects a `HTMLCanvasElement` element appearing on the page. You can also call
other locator functions such as `.click()` or `.fill()` on the function locator.

```ts
await page
  .locator(() => {
    let resolve!: (node: HTMLCanvasElement) => void;
    const promise = new Promise(res => {
      return (resolve = res);
    });
    const observer = new MutationObserver(records => {
      for (const record of records) {
        if (record.target instanceof HTMLCanvasElement) {
          resolve(record.target);
        }
      }
    });
    observer.observe(document);
    return promise;
  })
  .wait();
```

### Applying filters on locators

The following example shows how to add extra conditions to the locator expressed
as a JavaScript function. The button element will only be clicked if its
`innerText` is 'My button'.

```ts
await page
  .locator('button')
  .filter(button => button.innerText === 'My button')
  .click();
```

### Returning values from a locator

The [`map`](https://pptr.dev/api/puppeteer.locator.map/) function allows mapping
an element to a JavaScript value. In this case, calling `wait()` will return the
deserialized JavaScript value.

```ts
const enabled = await page
  .locator('button')
  .map(button => !button.disabled)
  .wait();
```

### Returning ElementHandles from a locator

The [`waitHandle`](https://pptr.dev/api/puppeteer.locator.waithandle/) function
allows returning the
[ElementHandle](https://pptr.dev/api/puppeteer.elementhandle/). It might be
useful if there is no corresponding locator API for the action you need.

```ts
const buttonHandle = await page.locator('button').waitHandle();
await buttonHandle.click();
```

### Configuring locators

Locators can be configured to tune configure the preconditions and other options:

```ts
// Clicks on a button without waiting for any preconditions.
await page
  .locator('button')
  .setEnsureElementIsInTheViewport(false)
  .setVisibility(null)
  .setWaitForEnabled(false)
  .setWaitForStableBoundingBox(false)
  .click();
```

### Locator timeouts

By default, locators inherit the timeout setting from the page. But it is
possible to set the timeout on the per-locator basis. A
[TimeoutError](https://pptr.dev/api/puppeteer.timeouterror/) will be thrown if
the element is not found or the preconditions are not met within the specified
time period.

```ts
// Time out after 3 sec.
await page.locator('button').setTimeout(3000).click();
```

### Getting locator events

Currently, locators support [a single
event](https://pptr.dev/api/puppeteer.locatorevents/) that notifies you when the
locator is about to perform the action indicating that pre-conditions have been
met:

```ts
let willClick = false;
await page
  .locator('button')
  .on(LocatorEvent.Action, () => {
    willClick = true;
  })
  .click();
```

This event can be used for logging/debugging or other purposes. The event might
fire multiple times if the locator retries the action.

## waitForSelector

[`waitForSelector`](https://pptr.dev/api/puppeteer.page.waitforselector/) is a
lower-level API compared to locators that allows waiting for an element to be
available in DOM. It does not automatically retry the action if it fails and
requires manually disposing the resulting ElementHandle to prevent memory leaks.
The method exists on the Page, Frame and ElementHandle instances.

```ts
// Import puppeteer
import puppeteer from 'puppeteer';

// Launch the browser.
const browser = await puppeteer.launch();

// Create a page.
const page = await browser.newPage();

// Go to your site.
await page.goto('YOUR_SITE');

// Query for an element handle.
const element = await page.waitForSelector('div > .class-name');

// Do something with element...
await element.click(); // Just an example.

// Dispose of handle.
await element.dispose();

// Close browser.
await browser.close();
```

Some page level APIs such as `page.click(selector)`, `page.type(selector)`,
`page.hover(selector)` are implemented using `waitForSelector` for
backwards-compatibility reasons.

## Querying without waiting

Sometimes you know that the elements are already on the page. In that case,
Puppeteer offers multiple ways to find an element or multiple elements matching a
selector. These methods exist on Page, Frame and ElementHandle instances.

- [`page.$()`](https://pptr.dev/api/puppeteer.page._/) returns a single element
  matching a selector.
- [`page.$$()`](https://pptr.dev/api/puppeteer.page.__) returns all elements matching a selector.
- [`page.$eval()`](https://pptr.dev/api/puppeteer.page._eval) returns the result
  of running a JavaScript function on the first element matching a selector.
- [`page.$$eval()`](https://pptr.dev/api/puppeteer.page.__eval) returns the
  result of running a JavaScript function on each element matching a selector.

## Selectors

Puppeteer accepts [CSS
selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors) in
every API that accepts a selector. Additionally, you can opt-in into using
additional selector syntax to do more than CSS selectors offer.

### Non-CSS selectors

Puppeteer extends the CSS syntax with custom
[pseudo-elements](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements)
that define how to select an element using a non-CSS selector. The Puppeteer
supported pseudo-elements are prefixed with a `-p` vendor prefix.

#### XPath selectors (`-p-xpath`)

XPath selectors will use the browser's native [`Document.evaluate`](https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate) to query for elements.

```ts
// Runs the `//h2` as the XPath expression.
const element = await page.waitForSelector('::-p-xpath(//h2)');
```

#### Text selectors (`-p-text`)

Text selectors will select "minimal" elements containing the given text, even
within (open) shadow roots. Here, "minimum" means the deepest elements that
contain a given text, but not their parents (which technically will also contain
the given text).

```ts
// Click a button inside a div element that has Checkout as the inner text.
await page.locator('div ::-p-text(Checkout)').click();
// You need to escape CSS selector syntax such '(', ')' if it is part of the your search text ('Checkout (2 items)').
await page.locator(':scope >>> ::-p-text(Checkout \\(2 items\\))').click();
// or use quotes escaping any quotes that are part of the search text ('He said: "Hello"').
await page.locator(':scope >>> ::-p-text("He said: \\"Hello\\"")').click();
```

#### ARIA selectors (`-p-aria`)

ARIA selectors can be used to find elements using the computed accessible name
and role. These labels are computed using the browsers internal representation
of the accessibility tree. That means that ARIA relationships such as labeledby
are resolved before the query is run. The ARIA selectors are useful if you do
not want to depend on any particular DOM structure or DOM attributes.

```ts
await page.locator('::-p-aria(Submit)').click();
await page.locator('::-p-aria([name="Click me"][role="button"])').click();
```

#### Pierce selector (`pierce/`)

Pierce selector is a selector that returns all elements matching the provided CSS selector in
all shadow roots in the document. We recommend using [deep
combinators](#querying-elements-in-shadow-dom) instead because they offer more
flexibility in combining difference selectors. `pierce/` is only available in
the [prefixed notation](#prefixed-selector-syntax).

```ts
await page.locator('pierce/div').click();
// Same query as the pierce/ one using deep combinators.
await page.locator('& >>> div').click();
```

### Querying elements in Shadow DOM

CSS selectors do not allow descending into Shadow DOM, therefore, Puppeteer adds
two combinators to the CSS selector syntax that allow searching inside [shadow
DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM).

#### The `>>>` combinator

The `>>>` is called the _deep descendent_ combinator. It is analogous to the
CSS's descendent combinator (denoted with a single space character <code>&nbsp;</code>, for
example, `div button`) and it selects matching elements under the parent element
at any depth. For example, `my-custom-element >>> button` would select all
button elements that are available inside shadow DOM of the `my-custom-element`
(the shadow host).

:::note

Deep combinators only work on the first "depth" of CSS selectors and open shadow
roots; for example, `:is(div > > a)` will not work.

:::

#### The `>>>>` combinator

The `>>>>` is called the _deep child_ combinator. It is analogous to the CSS's
child combinator (denoted with `>`, for example, `div > button`) and it selects
matching elements under the parent element's immediate shadow root, if the
element has one. For example,
`my-custom-element >>>> button` would select all button elements that are available
inside the immediate shadow root of the `my-custom-element` (the shadow host).

### Custom selectors

You can also add your own pseudo element using
[Puppeteer.registerCustomQueryHandler](../api/puppeteer.puppeteer.registercustomqueryhandler.md).
This is useful for creating custom selectors based on framework objects or your application.

For example, you can write all your selectors using the `react-component` pseudo-element
and implement a custom logic how to resolve the provided ID.

```ts
Puppeteer.registerCustomQueryHandler('react-component', {
  queryOne: (elementOrDocument, selector) => {
    // Dummy example just delegates to querySelector but you can find your
    // React component because this callback runs in the page context.
    return elementOrDocument.querySelector(`[id="${CSS.escape(selector)}"]`);
  },
  queryAll: (elementOrDocument, selector) => {
    // Dummy example just delegates to querySelector but you can find your
    // React component because this callback runs in the page context.
    return elementOrDocument.querySelectorAll(`[id="${CSS.escape(selector)}"]`);
  },
});
```

In your application you can now write selectors as following.

```ts
await page.locator('::-p-react-component(MyComponent)').click();
// OR used in conjunction with other selectors.
await page.locator('.side-bar ::-p-react-component(MyComponent)').click();
```

Another example shows how you can define a custom query handler for locating vue
components:

:::caution

Be careful when relying on internal APIs of libraries or frameworks. They can change at any time.

:::

```ts
Puppeteer.registerCustomQueryHandler('vue', {
  queryOne: (element, name) => {
    const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);
    do {
      const currentNode = walker.currentNode;
      if (
        currentNode.__vnode?.ctx?.type?.name.toLowerCase() ===
        name.toLocaleLowerCase()
      ) {
        return currentNode;
      }
    } while (walker.nextNode());

    return null;
  },
});
```

Search for a given view component as following:

```ts
const element = await page.$('::-p-vue(MyComponent)');
```

### Prefixed selector syntax

:::caution

While we maintain prefixed selectors, the recommended way is to use the selector syntax documented above.

:::

The following legacy syntax (`${nonCssSelectorName}/${nonCssSelector}`) allows
running a single non-CSS selector at a time is also supported. Note that this
syntax does not allow combining multiple selectors.

```ts
// Same as ::-p-text("My text").
await page.locator('text/My text').click();
// Same as ::-p-xpath(//h2).
await page.locator('xpath///h2').click();
// Same as ::-p-aria(My label).
await page.locator('aria/My label').click();

await page.locator('pierce/div').click();
```

    # PDF generation

For printing PDFs use [`Page.pdf()`](https://pptr.dev/api/puppeteer.page.pdf).

```ts
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com', {
  waitUntil: 'networkidle2',
});
// Saves the PDF to hn.pdf.
await page.pdf({
  path: 'hn.pdf',
});

await browser.close();
```

By default, the [`Page.pdf()`](https://pptr.dev/api/puppeteer.page.pdf) waits for fonts to be loaded.

    # Running Puppeteer in Chrome extensions

:::caution

Chrome extensions environment is significantly different from the usual Node.JS environment, therefore, the support for running Puppeteer in chrome.debugger
is currently experimental. Please submit issues https://github.com/puppeteer/puppeteer/issues/new/choose if you encounted bugs.

:::

Chrome Extensions allow accessing Chrome DevTools Protocol via [`chrome.debugger`](https://developer.chrome.com/docs/extensions/reference/api/debugger).
[`chrome.debugger`](https://developer.chrome.com/docs/extensions/reference/api/debugger) provides a restricted access to CDP and allows attaching to one
page at a time. Therefore, Puppeteer requires a different transport to be used and Puppeteer's view is limited to a single page. It means you can
interact with a single page and its frames and workers but cannot create new pages using Puppeteer. To create a new page you need to use the
[`chrome.tabs`](https://developer.chrome.com/docs/extensions/reference/api/tabs) API and establish a new Puppeteer connection.

## How to run Puppeteer in Chrome extensions

:::note

See https://github.com/puppeteer/puppeteer/tree/main/examples/puppeteer-in-extension for a complete example.

:::

To run Puppeteer in an extension, first you need to produce a browser-compatible build using a bundler such as rollup or webpack:

1. When importing Puppeteer use the browser-specific entrypoint from puppeteer-core `puppeteer-core/lib/esm/puppeteer/puppeteer-core-browser.js'`:

```ts
import {
  connect,
  ExtensionTransport,
} from 'puppeteer-core/lib/esm/puppeteer/puppeteer-core-browser.js';

// Create a tab or find a tab to attach to.
const tab = await chrome.tabs.create({
  url,
});
// Connect Puppeteer using the ExtensionTransport.connectTab.
const browser = await connect({
  transport: await ExtensionTransport.connectTab(tab.id),
});
// You will have a single page on the browser object, which corresponds
// to the tab you connected the transport to.
const [page] = await browser.pages();
// Perform the usual operations with Puppeteer page.
console.log(await page.evaluate('document.title'));
browser.disconnect();
```

2. Build your extension using a bundler. For example, the following configuration can be used with rollup:

```js
import {nodeResolve} from '@rollup/plugin-node-resolve';

export default {
  input: 'main.mjs',
  output: {
    format: 'esm',
    dir: 'out',
  },
  // If you do not need to use WebDriver BiDi protocol,
  // exclude chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js to minimize the bundle size.
  external: ['chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js'],
  plugins: [
    nodeResolve({
      // Indicate that we target a browser environment.
      browser: true,
      // Exclude any dependencies except for puppeteer-core.
      // `npm install puppeteer-core` # To install puppeteer-core if needed.
      resolveOnly: ['puppeteer-core'],
    }),
  ],
};
```

    # Running Puppeteer in the browser

Puppeteer is a powerful tool for automating browsers, but did you know it can also run within a browser itself? This enables you to leverage Puppeteer's capabilities for tasks that don't require Node.js specific features.

## Supported Features

While running in the browser, Puppeteer offers a variety of functionalities including:

1. WebSocket Connections: Establish connections to existing browser instances using WebSockets. Launching or downloading browsers directly is not supported as it relies on Node.js APIs.
2. Script Evaluation: Execute JavaScript code within the browser context.
3. Document Manipulation: Generate PDFs and screenshots of the current web page.
4. Page Management: Create, close, and navigate between different web pages.
5. Cookie Handling: Inspect, modify, and manage cookies within the browser.
6. Network Control: Monitor and intercept network requests made by the browser.

## How to run Puppeteer in the browser

:::note

See https://github.com/puppeteer/puppeteer/tree/main/examples/puppeteer-in-browser for a complete example.

:::

To run Puppeteer in the browser, first you need to produce a browser-compatible build using a bundler such as rollup or webpack:

1. When importing Puppeteer use the browser-specific entrypoint from puppeteer-core `puppeteer-core/lib/esm/puppeteer/puppeteer-core-browser.js'`:

```ts
import puppeteer from 'puppeteer-core/lib/esm/puppeteer/puppeteer-core-browser.js';

const browser = await puppeteer.connect({
  browserWSEndpoint: wsUrl,
});

alert('Browser has ' + (await browser.pages()).length + ' pages');

browser.disconnect();
```

2. Build your app using a bundler. For example, the following configuration can be used with rollup:

```js
import {nodeResolve} from '@rollup/plugin-node-resolve';

export default {
  input: 'main.mjs',
  output: {
    format: 'esm',
    dir: 'out',
  },
  // If you do not need to use WebDriver BiDi protocol,
  // exclude chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js to minimize the bundle size.
  external: ['chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js'],
  plugins: [
    nodeResolve({
      // Indicate that we target a browser environment.
      browser: true,
      // Exclude any dependencies except for puppeteer-core.
      // `npm install puppeteer-core` # To install puppeteer-core if needed.
      resolveOnly: ['puppeteer-core'],
    }),
  ],
};
```

:::note

Do not forget to include a valid browser WebSocket endpoint when connecting to an instance.

:::

3. Include the produced bundle into a web page.

    # Screenshots

For capturing screenshots use [`Page.screenshot()`](https://pptr.dev/api/puppeteer.page.screenshot).

```ts
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com', {
  waitUntil: 'networkidle2',
});
await page.screenshot({
  path: 'hn.png',
});

await browser.close();
```

You can also capture a screenshot of a specific element using [`ElementHandle.screenshot()`](https://pptr.dev/api/puppeteer.elementhandle.screenshot):

```ts
const fileElement = await page.waitForSelector('div');
await fileElement.screenshot({
  path: 'div.png',
});
```

By default, [`ElementHandle.screenshot()`](https://pptr.dev/api/puppeteer.elementhandle.screenshot) tries to scroll the element into view
if it is hidden.

    # System requirements

- Node 18+. Puppeteer follows the latest
  [maintenance LTS](https://github.com/nodejs/Release#release-schedule) version of
  Node

- TypeScript 4.7.4+ (If used with TypeScript)

- Chrome for Testing browser system requirements:
  - [Windows](https://support.google.com/chrome/a/answer/7100626?hl=en#:~:text=the%20specified%20criteria.-,Windows,-To%20use%20Chrome), x64 architecture
  - [MacOS](https://support.google.com/chrome/a/answer/7100626?hl=en#:~:text=Not%20yet%20scheduled-,Mac,-To%20use%20Chrome), x64 and arm64 architectures
  - [Debian/Ubuntu Linux](https://support.google.com/chrome/a/answer/7100626?hl=en#:~:text=10.15%20or%20later-,Linux,-To%20use%20Chrome), with x64 architecture
    - Required system packages https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/debian/dist_package_versions.json
  - [openSUSE/Fedora Linux](https://support.google.com/chrome/a/answer/7100626?hl=en#:~:text=10.15%20or%20later-,Linux,-To%20use%20Chrome), with x64 architecture
    - Required system packages https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/rpm/dist_package_provides.json

- Firefox browser system requirements:
  - https://www.mozilla.org/en-US/firefox/system-requirements/
  - The `xz` or `bzip2` utilities are required to unpack Firefox versions for Linux.

    # What is Puppeteer?

Puppeteer is a JavaScript library which provides a high-level API to
control Chrome or Firefox over the [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) or
[WebDriver BiDi](https://pptr.dev/webdriver-bidi). Puppeteer runs in the
headless (no visible UI) by default but can be configured to run in a
visible ("headful") browser.

# Features

Most things that you can do manually in the browser can be done using Puppeteer!
Here are a few examples to get you started:

- Automate form submission, UI testing, keyboard input, etc.
- Create an automated testing environment using the latest JavaScript and
  browser features.
- Capture a
  [timeline trace](https://developer.chrome.com/docs/devtools/performance/reference)
  of your site to help diagnose performance issues.
- [Test Chrome Extensions](https://pptr.dev/guides/chrome-extensions).
- Generate screenshots and PDFs of pages.
- Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e.
  "SSR" (Server-Side Rendering)).

    ---
hide_table_of_contents: true
---

# Puppeteer

[![build](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml)
[![npm puppeteer package](https://img.shields.io/npm/v/puppeteer.svg)](https://npmjs.org/package/puppeteer)

<img src="https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png" height="200" align="right"/>

> Puppeteer is a JavaScript library which provides a high-level API to control
> Chrome or Firefox over the
> [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) or [WebDriver BiDi](https://pptr.dev/webdriver-bidi).
> Puppeteer runs in the headless (no visible UI) by default

## [Get started](https://pptr.dev/docs) | [API](https://pptr.dev/api) | [FAQ](https://pptr.dev/faq) | [Contributing](https://pptr.dev/contributing) | [Troubleshooting](https://pptr.dev/troubleshooting)

## Installation

```bash npm2yarn
npm i puppeteer # Downloads compatible Chrome during installation.
npm i puppeteer-core # Alternatively, install as a library, without downloading Chrome.
```

## Example

```ts
import puppeteer from 'puppeteer';
// Or import puppeteer from 'puppeteer-core';

// Launch the browser and open a new blank page
const browser = await puppeteer.launch();
const page = await browser.newPage();

// Navigate the page to a URL.
await page.goto('https://developer.chrome.com/');

// Set screen size.
await page.setViewport({width: 1080, height: 1024});

// Type into search box using accessible input name.
await page.locator('aria/Search').fill('automate beyond recorder');

// Wait and click on first result.
await page.locator('.devsite-result-item-link').click();

// Locate the full title with a unique string.
const textSelector = await page
  .locator('text/Customize and automate')
  .waitHandle();
const fullTitle = await textSelector?.evaluate(el => el.textContent);

// Print the full title.
console.log('The title of this blog post is "%s".', fullTitle);

await browser.close();
```

    # Supported browsers

## Chrome

Starting with v20.0.0 Puppeteer downloads and works with **[Chrome for Testing](https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#what-is-chrome-for-testing)**, which supports both headless and headful modes sharing the same code path in the browser.
The old headless mode is now a separate program called **[chrome-headless-shell](https://developer.chrome.com/blog/chrome-headless-shell)** (use `headless: 'shell'` with Puppeteer).

Prior to this version Puppeteer downloaded and worked with Chromium.

## Firefox

Starting with v23.0.0 Puppeteer downloads and works with the stable release of [Firefox](https://www.mozilla.org/en-US/firefox/).

Prior to this version Puppeteer downloaded and worked with the nightly versions of Firefox at the time.

## Supported browser version list

The following table provides mapping between the Puppeteer version and the browsers version you can use it with.
If an exact matching version of Puppeteer isn't listed, the supported version of the browser is that for the immediately prior version:

<!-- version-start -->

| Puppeteer                                                                                              | Chrome                                                                                     | Firefox                                                   |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| [Puppeteer v24.19.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.19.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 140.0.7339.80  | [Firefox](https://www.mozilla.org/en-US/firefox/) 142.0.1 |
| [Puppeteer v24.17.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.17.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 139.0.7258.154 | [Firefox](https://www.mozilla.org/en-US/firefox/) 142.0.1 |
| [Puppeteer v24.17.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.17.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 139.0.7258.138 | [Firefox](https://www.mozilla.org/en-US/firefox/) 142.0   |
| [Puppeteer v24.16.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.16.2/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 139.0.7258.68  | [Firefox](https://www.mozilla.org/en-US/firefox/) 141.0.3 |
| [Puppeteer v24.16.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.16.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 139.0.7258.66  | [Firefox](https://www.mozilla.org/en-US/firefox/) 141.0.3 |
| [Puppeteer v24.16.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.16.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 139.0.7258.66  | [Firefox](https://www.mozilla.org/en-US/firefox/) 141.0.2 |
| [Puppeteer v24.15.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.15.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 138.0.7204.168 | [Firefox](https://www.mozilla.org/en-US/firefox/) 141.0   |
| [Puppeteer v24.14.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.14.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 138.0.7204.157 | [Firefox](https://www.mozilla.org/en-US/firefox/) 140.0.4 |
| [Puppeteer v24.12.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.12.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 138.0.7204.94  | [Firefox](https://www.mozilla.org/en-US/firefox/) 140.0.4 |
| [Puppeteer v24.11.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.11.2/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 138.0.7204.92  | [Firefox](https://www.mozilla.org/en-US/firefox/) 140.0.2 |
| [Puppeteer v24.11.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.11.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 138.0.7204.49  | [Firefox](https://www.mozilla.org/en-US/firefox/) 140.0.2 |
| [Puppeteer v24.11.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.11.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 138.0.7204.49  | [Firefox](https://www.mozilla.org/en-US/firefox/) 140.0   |
| [Puppeteer v24.10.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.10.2/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 137.0.7151.119 | [Firefox](https://www.mozilla.org/en-US/firefox/) 139.0.4 |
| [Puppeteer v24.10.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.10.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 137.0.7151.70  | [Firefox](https://www.mozilla.org/en-US/firefox/) 139.0.4 |
| [Puppeteer v24.10.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.10.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 137.0.7151.55  | [Firefox](https://www.mozilla.org/en-US/firefox/) 139.0.1 |
| [Puppeteer v24.9.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.9.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 136.0.7103.94  | [Firefox](https://www.mozilla.org/en-US/firefox/) 138.0.4 |
| [Puppeteer v24.8.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.8.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 136.0.7103.92  | [Firefox](https://www.mozilla.org/en-US/firefox/) 138.0.1 |
| [Puppeteer v24.8.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.8.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 136.0.7103.49  | [Firefox](https://www.mozilla.org/en-US/firefox/) 138.0.1 |
| [Puppeteer v24.7.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.7.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 135.0.7049.114 | [Firefox](https://www.mozilla.org/en-US/firefox/) 137.0.2 |
| [Puppeteer v24.7.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.7.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 135.0.7049.95  | [Firefox](https://www.mozilla.org/en-US/firefox/) 137.0.2 |
| [Puppeteer v24.6.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.6.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 135.0.7049.84  | [Firefox](https://www.mozilla.org/en-US/firefox/) 137.0.1 |
| [Puppeteer v24.6.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.6.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 135.0.7049.42  | [Firefox](https://www.mozilla.org/en-US/firefox/) 137.0   |
| [Puppeteer v24.5.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.5.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 134.0.6998.165 | [Firefox](https://www.mozilla.org/en-US/firefox/) 136.0.4 |
| [Puppeteer v24.4.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.4.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 134.0.6998.35  | [Firefox](https://www.mozilla.org/en-US/firefox/) 136.0   |
| [Puppeteer v24.3.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.3.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 133.0.6943.141 | [Firefox](https://www.mozilla.org/en-US/firefox/) 135.0.1 |
| [Puppeteer v24.3.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.3.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 133.0.6943.126 | [Firefox](https://www.mozilla.org/en-US/firefox/) 135.0.1 |
| [Puppeteer v24.2.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.2.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 133.0.6943.98  | [Firefox](https://www.mozilla.org/en-US/firefox/) 135.0   |
| [Puppeteer v24.2.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.2.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 133.0.6943.53  | [Firefox](https://www.mozilla.org/en-US/firefox/) 135.0   |
| [Puppeteer v24.1.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.1.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 132.0.6834.110 | [Firefox](https://www.mozilla.org/en-US/firefox/) 134.0.2 |
| [Puppeteer v24.1.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.1.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 132.0.6834.83  | [Firefox](https://www.mozilla.org/en-US/firefox/) 134.0.1 |
| [Puppeteer v24.0.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v24.0.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 131.0.6778.264 | [Firefox](https://www.mozilla.org/en-US/firefox/) 134.0   |
| [Puppeteer v23.11.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.11.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 131.0.6778.204 | [Firefox](https://www.mozilla.org/en-US/firefox/) 133.0.3 |
| [Puppeteer v23.10.4](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.10.4/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 131.0.6778.108 | [Firefox](https://www.mozilla.org/en-US/firefox/) 133.0.3 |
| [Puppeteer v23.10.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.10.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 131.0.6778.87  | [Firefox](https://www.mozilla.org/en-US/firefox/) 133.0   |
| [Puppeteer v23.10.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.10.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 131.0.6778.85  | [Firefox](https://www.mozilla.org/en-US/firefox/) 133.0   |
| [Puppeteer v23.9.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.9.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 131.0.6778.85  | [Firefox](https://www.mozilla.org/en-US/firefox/) 132.0.2 |
| [Puppeteer v23.8.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.8.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 131.0.6778.69  | [Firefox](https://www.mozilla.org/en-US/firefox/) 132.0.2 |
| [Puppeteer v23.7.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.7.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 130.0.6723.116 | [Firefox](https://www.mozilla.org/en-US/firefox/) 132.0.1 |
| [Puppeteer v23.7.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.7.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 130.0.6723.91  | [Firefox](https://www.mozilla.org/en-US/firefox/) 132.0   |
| [Puppeteer v23.6.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.6.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 130.0.6723.69  | [Firefox](https://www.mozilla.org/en-US/firefox/) 131.0.3 |
| [Puppeteer v23.6.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.6.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 130.0.6723.58  | [Firefox](https://www.mozilla.org/en-US/firefox/) 131.0.3 |
| [Puppeteer v23.5.3](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.5.3/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 129.0.6668.100 | [Firefox](https://www.mozilla.org/en-US/firefox/) 131.0.2 |
| [Puppeteer v23.5.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.5.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 129.0.6668.91  | [Firefox](https://www.mozilla.org/en-US/firefox/) 131.0   |
| [Puppeteer v23.5.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.5.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 129.0.6668.89  | [Firefox](https://www.mozilla.org/en-US/firefox/) 131.0   |
| [Puppeteer v23.4.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.4.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 129.0.6668.70  | [Firefox](https://www.mozilla.org/en-US/firefox/) 130.0.1 |
| [Puppeteer v23.4.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.4.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 129.0.6668.58  | [Firefox](https://www.mozilla.org/en-US/firefox/) 130.0.1 |
| [Puppeteer v23.3.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.3.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 128.0.6613.137 | [Firefox](https://www.mozilla.org/en-US/firefox/) 130.0   |
| [Puppeteer v23.3.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.3.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 128.0.6613.119 | [Firefox](https://www.mozilla.org/en-US/firefox/) 130.0   |
| [Puppeteer v23.2.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.2.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 128.0.6613.119 | [Firefox](https://www.mozilla.org/en-US/firefox/) 129.0.2 |
| [Puppeteer v23.2.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.2.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 128.0.6613.86  | [Firefox](https://www.mozilla.org/en-US/firefox/) 129.0.2 |
| [Puppeteer v23.2.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.2.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 128.0.6613.84  | [Firefox](https://www.mozilla.org/en-US/firefox/) 129.0.2 |
| [Puppeteer v23.1.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.1.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 127.0.6533.119 | [Firefox](https://www.mozilla.org/en-US/firefox/) 129.0.2 |
| [Puppeteer v23.1.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.1.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 127.0.6533.119 | [Firefox](https://www.mozilla.org/en-US/firefox/) 129.0   |
| [Puppeteer v23.0.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.0.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 127.0.6533.99  | [Firefox](https://www.mozilla.org/en-US/firefox/) 129.0   |
| [Puppeteer v23.0.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.0.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 127.0.6533.88  | [Firefox](https://www.mozilla.org/en-US/firefox/) 129.0   |
| [Puppeteer v22.15.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.15.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 127.0.6533.88  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.14.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.14.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 127.0.6533.72  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.13.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.13.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 126.0.6478.182 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.12.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.12.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 126.0.6478.126 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.12.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.12.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 126.0.6478.63  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.11.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.11.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 126.0.6478.61  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.11.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.11.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 126.0.6478.55  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.10.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.10.1/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 125.0.6422.141 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.10.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.10.0/docs/api/index.md) | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 125.0.6422.78  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.9.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.9.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 125.0.6422.60  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.8.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.8.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 124.0.6367.207 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.8.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.8.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 124.0.6367.201 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.8.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.8.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 124.0.6367.91  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.7.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.7.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 124.0.6367.78  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.7.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.7.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 124.0.6367.60  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.6.4](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.6.4/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 123.0.6312.122 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.6.3](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.6.3/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 123.0.6312.105 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.6.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.6.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 123.0.6312.86  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.6.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.6.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 123.0.6312.58  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.5.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.5.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 122.0.6261.128 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.4.1](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.4.1/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 122.0.6261.111 | Firefox Nightly (at the time)                             |
| [Puppeteer v22.4.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.4.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 122.0.6261.94  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.3.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.3.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 122.0.6261.69  | Firefox Nightly (at the time)                             |
| [Puppeteer v22.2.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v22.2.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 122.0.6261.57  | Firefox Nightly (at the time)                             |
| [Puppeteer v21.9.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.9.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 121.0.6167.85  | Firefox Nightly (at the time)                             |
| [Puppeteer v21.8.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.8.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 120.0.6099.109 | Firefox Nightly (at the time)                             |
| [Puppeteer v21.5.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.5.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 119.0.6045.105 | Firefox Nightly (at the time)                             |
| [Puppeteer v21.4.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.4.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 118.0.5993.70  | Firefox Nightly (at the time)                             |
| [Puppeteer v21.3.7](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.3.7/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 117.0.5938.149 | Firefox Nightly (at the time)                             |
| [Puppeteer v21.3.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.3.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 117.0.5938.92  | Firefox Nightly (at the time)                             |
| [Puppeteer v21.3.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.3.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 117.0.5938.62  | Firefox Nightly (at the time)                             |
| [Puppeteer v21.1.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.1.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 116.0.5845.96  | Firefox Nightly (at the time)                             |
| [Puppeteer v21.0.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.0.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 115.0.5790.170 | Firefox Nightly (at the time)                             |
| [Puppeteer v21.0.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v21.0.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 115.0.5790.102 | Firefox Nightly (at the time)                             |
| [Puppeteer v20.9.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v20.9.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 115.0.5790.98  | Firefox Nightly (at the time)                             |
| [Puppeteer v20.7.2](https://github.com/puppeteer/puppeteer/blob/puppeteer-v20.7.2/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 114.0.5735.133 | Firefox Nightly (at the time)                             |
| [Puppeteer v20.6.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v20.6.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 114.0.5735.90  | Firefox Nightly (at the time)                             |
| [Puppeteer v20.1.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v20.1.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 113.0.5672.63  | Firefox Nightly (at the time)                             |
| [Puppeteer v20.0.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v20.0.0/docs/api/index.md)   | [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) 112.0.5615.121 | Firefox Nightly (at the time)                             |
| [Puppeteer v19.8.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v19.8.0/docs/api/index.md)   | Chromium 112.0.5614.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v19.7.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v19.7.0/docs/api/index.md)   | Chromium 111.0.5556.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v19.6.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v19.6.0/docs/api/index.md)   | Chromium 110.0.5479.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v19.4.0](https://github.com/puppeteer/puppeteer/blob/puppeteer-v19.4.0/docs/api/index.md)   | Chromium 109.0.5412.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v19.2.0](https://github.com/puppeteer/puppeteer/blob/v19.2.0/docs/api/index.md)             | Chromium 108.0.5351.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v18.1.0](https://github.com/puppeteer/puppeteer/blob/v18.1.0/docs/api/index.md)             | Chromium 107.0.5296.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v17.1.0](https://github.com/puppeteer/puppeteer/blob/v17.1.0/docs/api/index.md)             | Chromium 106.0.5249.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v15.5.0](https://github.com/puppeteer/puppeteer/blob/v15.5.0/docs/api/index.md)             | Chromium 105.0.5173.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v15.1.0](https://github.com/puppeteer/puppeteer/blob/v15.1.0/docs/api.md)                   | Chromium 104.0.5109.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v14.2.0](https://github.com/puppeteer/puppeteer/blob/v14.2.0/docs/api.md)                   | Chromium 103.0.5059.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v14.0.0](https://github.com/puppeteer/puppeteer/blob/v14.0.0/docs/api.md)                   | Chromium 102.0.5002.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v13.6.0](https://github.com/puppeteer/puppeteer/blob/v13.6.0/docs/api.md)                   | Chromium 101.0.4950.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v13.5.0](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md)                   | Chromium 100.0.4889.0                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v13.2.0](https://github.com/puppeteer/puppeteer/blob/v13.2.0/docs/api.md)                   | Chromium 99.0.4844.16                                                                      | Firefox Nightly (at the time)                             |
| [Puppeteer v13.1.0](https://github.com/puppeteer/puppeteer/blob/v13.1.0/docs/api.md)                   | Chromium 98.0.4758.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v12.0.0](https://github.com/puppeteer/puppeteer/blob/v12.0.0/docs/api.md)                   | Chromium 97.0.4692.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v10.2.0](https://github.com/puppeteer/puppeteer/blob/v10.2.0/docs/api.md)                   | Chromium 93.0.4577.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v10.0.0](https://github.com/puppeteer/puppeteer/blob/v10.0.0/docs/api.md)                   | Chromium 92.0.4512.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v9.0.0](https://github.com/puppeteer/puppeteer/blob/v9.0.0/docs/api.md)                     | Chromium 91.0.4469.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v8.0.0](https://github.com/puppeteer/puppeteer/blob/v8.0.0/docs/api.md)                     | Chromium 90.0.4427.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v7.0.0](https://github.com/puppeteer/puppeteer/blob/v7.0.0/docs/api.md)                     | Chromium 90.0.4403.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v6.0.0](https://github.com/puppeteer/puppeteer/blob/v6.0.0/docs/api.md)                     | Chromium 89.0.4389.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v5.5.0](https://github.com/puppeteer/puppeteer/blob/v5.5.0/docs/api.md)                     | Chromium 88.0.4298.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v5.4.0](https://github.com/puppeteer/puppeteer/blob/v5.4.0/docs/api.md)                     | Chromium 87.0.4272.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v5.3.0](https://github.com/puppeteer/puppeteer/blob/v5.3.0/docs/api.md)                     | Chromium 86.0.4240.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v5.2.1](https://github.com/puppeteer/puppeteer/blob/v5.2.1/docs/api.md)                     | Chromium 85.0.4182.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v5.1.0](https://github.com/puppeteer/puppeteer/blob/v5.1.0/docs/api.md)                     | Chromium 84.0.4147.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v3.1.0](https://github.com/puppeteer/puppeteer/blob/v3.1.0/docs/api.md)                     | Chromium 83.0.4103.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v3.0.0](https://github.com/puppeteer/puppeteer/blob/v3.0.0/docs/api.md)                     | Chromium 81.0.4044.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v2.1.0](https://github.com/puppeteer/puppeteer/blob/v2.1.0/docs/api.md)                     | Chromium 80.0.3987.0                                                                       | Firefox Nightly (at the time)                             |
| [Puppeteer v2.0.0](https://github.com/puppeteer/puppeteer/blob/v2.0.0/docs/api.md)                     | Chromium 79.0.3942.0                                                                       | Firefox not supported                                     |
| [Puppeteer v1.20.0](https://github.com/puppeteer/puppeteer/blob/v1.20.0/docs/api.md)                   | Chromium 78.0.3882.0                                                                       | Firefox not supported                                     |
| [Puppeteer v1.19.0](https://github.com/puppeteer/puppeteer/blob/v1.19.0/docs/api.md)                   | Chromium 77.0.3803.0                                                                       | Firefox not supported                                     |
| [Puppeteer v1.17.0](https://github.com/puppeteer/puppeteer/blob/v1.17.0/docs/api.md)                   | Chromium 76.0.3803.0                                                                       | Firefox not supported                                     |
| [Puppeteer v1.15.0](https://github.com/puppeteer/puppeteer/blob/v1.15.0/docs/api.md)                   | Chromium 75.0.3765.0                                                                       | Firefox not supported                                     |
| [Puppeteer v1.13.0](https://github.com/puppeteer/puppeteer/blob/v1.13.0/docs/api.md)                   | Chromium 74.0.3723.0                                                                       | Firefox not supported                                     |
| [Puppeteer v1.12.2](https://github.com/puppeteer/puppeteer/blob/v1.12.2/docs/api.md)                   | Chromium 73.0.3679.0                                                                       | Firefox not supported                                     |

<!-- version-end -->

    # Troubleshooting

:::note

To keep this page up-to-date we largely rely on community contributions.
Please send a PR if you notice something is no longer up-to-date.

:::

## `Cannot find module 'puppeteer-core/internal/...'`

This can occur if your Node.js version is lower than 14 or if you are using a
custom resolver (such as
[`jest-resolve`](https://www.npmjs.com/package/jest-resolve)). For the former,
we do not support deprecated versions of Node.js. For the latter, usually
upgrading the resolver (or its parent module such as `jest`) will work (e.g.
https://github.com/puppeteer/puppeteer/issues/9121)

## `Could not find expected browser locally`

Starting from v19.0.0, Puppeteer will download browsers into
`~/.cache/puppeteer` using
[`os.homedir`](https://nodejs.org/api/os.html#oshomedir) for better caching
between Puppeteer upgrades. Generally the home directory is well-defined (even
on Windows), but occasionally the home directory may not be available. In this
case, we provide the `PUPPETEER_CACHE_DIR` variable which allows you to change
the installation directory.

For example,

```bash npm2yarn
PUPPETEER_CACHE_DIR=$(pwd) npm install puppeteer
PUPPETEER_CACHE_DIR=$(pwd) node <script-path>
```

You can also create a configuration file named `.puppeteerrc.cjs` (or
`puppeteer.config.cjs`) at the root of your application with the contents

```js
const {join} = require('path');

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};
```

You will need to reinstall `puppeteer` in order for the configuration to take
effect. See [Configuring Puppeteer](./guides/configuration) for more
information.

## `net::ERR_BLOCKED_BY_CLIENT` when navigating to an HTTP URL in Chrome

Chrome is rolling out a feature called `HttpsFirstBalancedModeAutoEnable` that
displays a warning to the user if the user navigates to an HTTP site. The feature
is enabled by default in Chrome for Testing builds that Puppeteer uses by
default.

The feature makes a navigation request to an HTTP URL result in the error
`net::ERR_BLOCKED_BY_CLIENT` which can be caught and recovered from. When the
error occurs, a warning page is shown to the user with a button to continue
navigation. The button is clickable via Puppeteer. Local HTTP hosts do not
trigger a warning but remote hosts might. For more details see
https://crbug.com/378022921

It is possible to disable this Chrome feature by passing the
`--disable-features=HttpsFirstBalancedModeAutoEnable` argument when launching
Chrome:

```ts
const browser = await puppeteer.launch({
  args: ['--disable-features=HttpsFirstBalancedModeAutoEnable'],
});
```

## Chrome doesn't launch on Windows

Some [chrome policies](https://support.google.com/chrome/a/answer/7532015) might
enforce running Chrome/Chromium with certain extensions.

Puppeteer passes `--disable-extensions` flag by default and will fail to launch
when such policies are active.

To work around this, set the `enableExtensions` option:

```ts
const browser = await puppeteer.launch({
  enableExtensions: true,
});
```

> Context:
> [issue 3681](https://github.com/puppeteer/puppeteer/issues/3681#issuecomment-447865342).

## Chrome reports sandbox errors on Windows

Chrome uses sandboxes on Windows which require additional permissions on
the downloaded Chrome files. Starting from Puppeteer v22.14.0, Puppeteer
will attempt to configure those permissions by running the `setup.exe`
tool provided by Chrome during the installation of the browser.

If you are using an older Puppeteer version or still seeing the
following errors in the browser output:

```
[24452:59820:0508/113713.058:ERROR:sandbox_win.cc(913)] Sandbox cannot access executable. Check filesystem permissions are valid. See https://bit.ly/31yqMJR.: Access is denied. (0x5)
```

You can use icacls to set permissions manually:

```powershell
icacls "%USERPROFILE%/.cache/puppeteer/chrome" /grant *S-1-15-2-1:(OI)(CI)(RX)
```

:::note

In high security environments a more restrictive SID should be used such
as one from the
[installer](https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/setup/install_worker.cc;l=74).

:::

See https://bit.ly/31yqMJR for more details.

## Chrome doesn't launch on Linux

Make sure all the necessary dependencies are installed. You can run `ldd chrome
| grep not` on a Linux machine to check which dependencies are missing. The
common ones are provided below. Also, see
https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/debian/dist_package_versions.json
for the up-to-date list of dependencies declared by the Chrome installer.

:::caution

Chrome currently does not provide arm64 binaries for Linux.
There are only arm64 binaries for Mac ARM.
That means that Linux binaries downloaded by default will not work on Linux arm64.

:::

<details>
<summary>Debian (e.g. Ubuntu) Dependencies</summary>

```
ca-certificates
fonts-liberation
libasound2
libatk-bridge2.0-0
libatk1.0-0
libc6
libcairo2
libcups2
libdbus-1-3
libexpat1
libfontconfig1
libgbm1
libgcc1
libglib2.0-0
libgtk-3-0
libnspr4
libnss3
libpango-1.0-0
libpangocairo-1.0-0
libstdc++6
libx11-6
libx11-xcb1
libxcb1
libxcomposite1
libxcursor1
libxdamage1
libxext6
libxfixes3
libxi6
libxrandr2
libxrender1
libxss1
libxtst6
lsb-release
wget
xdg-utils
```

</details>

<details>
<summary>CentOS Dependencies</summary>

```
alsa-lib.x86_64
atk.x86_64
cups-libs.x86_64
gtk3.x86_64
ipa-gothic-fonts
libXcomposite.x86_64
libXcursor.x86_64
libXdamage.x86_64
libXext.x86_64
libXi.x86_64
libXrandr.x86_64
libXScrnSaver.x86_64
libXtst.x86_64
pango.x86_64
xorg-x11-fonts-100dpi
xorg-x11-fonts-75dpi
xorg-x11-fonts-cyrillic
xorg-x11-fonts-misc
xorg-x11-fonts-Type1
xorg-x11-utils
```

After installing dependencies you need to update `nss` library using this
command

```
yum update nss -y
```

</details>

<details>
  <summary>Check out discussions</summary>

- [#290](https://github.com/puppeteer/puppeteer/issues/290) - Debian
  troubleshooting <br/>
- [#391](https://github.com/puppeteer/puppeteer/issues/391) - CentOS
  troubleshooting <br/>
- [#379](https://github.com/puppeteer/puppeteer/issues/379) - Alpine
  troubleshooting <br/>

</details>

## chrome-headless-shell disables GPU compositing

chrome-headless-shell requires `--enable-gpu` to
[enable GPU acceleration in headless mode](https://crbug.com/1416283).

```ts
const browser = await puppeteer.launch({
  headless: 'shell',
  args: ['--enable-gpu'],
});
```

## Setting up GPU with Chrome

Generally, Chrome should be able to detect and enable GPU if the system has appropriate drivers.
For additional tips, see the following blog post https://developer.chrome.com/blog/supercharge-web-ai-testing.

## Setting Up Chrome Linux Sandbox

In order to protect the host environment from untrusted web content, Chrome uses
[multiple layers of sandboxing](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/design/sandbox.md).
For this to work properly, the host should be configured first. If there's no
good sandbox for Chrome to use, it will crash with the error
`No usable sandbox!`.

If you **absolutely trust** the content you open in Chrome, you can launch
Chrome with the `--no-sandbox` argument:

```ts
const browser = await puppeteer.launch({
  args: ['--no-sandbox'],
});
```

:::caution

Running without a sandbox is **strongly discouraged**. Consider configuring a
sandbox instead.

:::

**The recommended way to run Chrome is using sandboxes**

### Issues with AppArmor on Ubuntu

Ubuntu 23.10+ (or possibly other Linux distros in the future) ship an
AppArmor profile that applies to Chrome stable binaries installed at
/opt/google/chrome/chrome (the default installation path). This policy
is stored at /etc/apparmor.d/chrome. This AppArmor policy prevents
Chrome for Testing binaries downloaded by Puppeteer from using user namespaces
resulting in the `No usable sandbox!` error when trying to launch the
browser.

For workarounds, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md.

### Using [setuid sandbox](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/suid_sandbox_development.md)

:::caution

IMPORTANT NOTE: The Linux SUID sandbox is almost but not completely removed. See https://bugs.chromium.org/p/chromium/issues/detail?id=598454 This section is mostly out-of-date.

:::

The setuid sandbox comes as a standalone executable and is located next to the
Chrome that Puppeteer downloads. It is fine to re-use the same sandbox
executable for different Chrome versions, so the following could be done only
once per host environment:

```bash
# cd to Puppeteer cache directory (adjust the path if using a different cache directory).
cd ~/.cache/puppeteer/chrome/linux-<version>/chrome-linux64/
sudo chown root:root chrome_sandbox
sudo chmod 4755 chrome_sandbox
# copy sandbox executable to a shared location
sudo cp -p chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
# export CHROME_DEVEL_SANDBOX env variable
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
```

You might want to export the `CHROME_DEVEL_SANDBOX` env variable by default. In
this case, add the following to the `~/.bashrc` or `.zshenv`:

```bash
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
```

or to your `Dockerfile`:

```
ENV CHROME_DEVEL_SANDBOX /usr/local/sbin/chrome-devel-sandbox
```

## Running Puppeteer on Travis CI

> 👋 We ran our tests for Puppeteer on Travis CI until v6.0.0 (when we've
> migrated to GitHub Actions) - see our historical
> [`.travis.yml` (v5.5.0)](https://github.com/puppeteer/puppeteer/blob/v5.5.0/.travis.yml)
> for reference.

Tips-n-tricks:

- [xvfb](https://en.wikipedia.org/wiki/Xvfb) service should be launched in order
  to run Chrome for Testing in non-headless mode
- Runs on Xenial Linux on Travis by default
- Runs `npm install` by default
- `node_modules` is cached by default

`.travis.yml` might look like this:

```yml
language: node_js
node_js: node
services: xvfb
script:
  - npm test
```

## Running Puppeteer on WSL (Windows subsystem for Linux)

See [this thread](https://github.com/puppeteer/puppeteer/issues/1837) with some
tips specific to WSL. In a nutshell, you need to install missing dependencies by
either:

1. [Installing Chrome on WSL to install all dependencies](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps#install-google-chrome-for-linux)
2. Installing required dependencies manually:
   `sudo apt install libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2`.

:::caution

The list of required dependencies might get outdated and depend on what you
already have installed.

:::

## Running Puppeteer on CircleCI

Running Puppeteer smoothly on CircleCI requires the following steps:

1. Start with a
   [NodeJS image](https://circleci.com/docs/2.0/circleci-images/#nodejs) in your
   config like so:
   ```yaml
   docker:
     - image: circleci/node:14 # Use your desired version
       environment:
         NODE_ENV: development # Only needed if puppeteer is in `devDependencies`
   ```
1. Dependencies like `libXtst6` probably need to be installed via `apt-get`, so
   use the
   [threetreeslight/puppeteer](https://circleci.com/orbs/registry/orb/threetreeslight/puppeteer)
   orb
   ([instructions](https://circleci.com/orbs/registry/orb/threetreeslight/puppeteer#quick-start)),
   or paste parts of its
   [source](https://circleci.com/orbs/registry/orb/threetreeslight/puppeteer#orb-source)
   into your own config.
1. Lastly, if you’re using Puppeteer through Jest, then you may encounter an
   error spawning child processes:
   ```
   [00:00.0]  jest args: --e2e --spec --max-workers=36
   Error: spawn ENOMEM
      at ChildProcess.spawn (internal/child_process.js:394:11)
   ```
   This is likely caused by Jest autodetecting the number of processes on the
   entire machine (`36`) rather than the number allowed to your container (`2`).
   To fix this, set `jest --maxWorkers=2` in your test command.

## Running Puppeteer in Docker

> 👋 We used [Cirrus Ci](https://cirrus-ci.org/) to run our tests for Puppeteer
> in a Docker container until v3.0.x - see our historical
> [`Dockerfile.linux` (v3.0.1)](https://github.com/puppeteer/puppeteer/blob/v3.0.1/.ci/node12/Dockerfile.linux)
> for reference. Starting from v16.0.0 we are shipping a Docker image via the
> GitHub registry. The Dockerfile is located
> [here](https://github.com/puppeteer/puppeteer/blob/main/docker/Dockerfile) and
> the usage instructions are in the
> [Integrations &gt; Docker](./guides/docker). The
> instructions below might be still helpful if you are building your own image.

Getting headless Chrome up and running in Docker can be tricky. The bundled
Chrome for Testing that Puppeteer installs is missing the necessary shared library
dependencies.

To fix, you'll need to install the missing dependencies and the latest Chrome for Testing
package in your Dockerfile:

```Dockerfile
FROM node:14-slim

# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chrome for Testing that Puppeteer
# installs, work.
RUN apt-get update \
    && apt-get install -y wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise
# uncomment the following lines to have `dumb-init` as PID 1
# ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init
# RUN chmod +x /usr/local/bin/dumb-init
# ENTRYPOINT ["dumb-init", "--"]

# Uncomment to skip the Chrome for Testing download when installing puppeteer. If you do,
# you'll need to launch puppeteer with:
#     browser.launch({executablePath: 'google-chrome-stable'})
# ENV PUPPETEER_SKIP_DOWNLOAD true

# Install puppeteer so it's available in the container.
RUN npm init -y &&  \
    npm i puppeteer \
    # Add user so we don't need --no-sandbox.
    # same layer as npm install to keep re-chowned files from using up several hundred MBs more space
    && groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
    && mkdir -p /home/pptruser/Downloads \
    && chown -R pptruser:pptruser /home/pptruser \
    && chown -R pptruser:pptruser /node_modules \
    && chown -R pptruser:pptruser /package.json \
    && chown -R pptruser:pptruser /package-lock.json

# Run everything after as non-privileged user.
USER pptruser

CMD ["google-chrome-stable"]
```

Build the container:

```bash
docker build -t puppeteer-chrome-linux .
```

Run the container by passing `node -e "<yourscript.js content as a string>"` as
the command:

```bash
 docker run -i --init --rm --cap-add=SYS_ADMIN \
   --name puppeteer-chrome puppeteer-chrome-linux \
   node -e "`cat yourscript.js`"
```

There's a full example at https://github.com/ebidel/try-puppeteer that shows how
to run this Dockerfile from a webserver running on App Engine Flex (Node).

### Running on Alpine

Note that Chrome [does not support Alpine out of the box](https://support.google.com/chrome/a/answer/7100626?hl=en#:~:text=10.15%20or%20later-,Linux,-To%20use%20Chrome) so make sure you have compatible system dependencies installed on Alpine and test the image before using it. See https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/rpm/dist_package_provides.json and https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/debian/dist_package_versions.json for the list of system packages required on supported distros.

> **CAUTION**
>
> The current Chromium version in Alpine 3.20 is causing timeout issues with Puppeteer. Downgrading to Alpine 3.19 fixes the issue.
> See [#11640](https://github.com/puppeteer/puppeteer/issues/11640), [#12637](https://github.com/puppeteer/puppeteer/issues/12637), [#12189](https://github.com/puppeteer/puppeteer/issues/12189)

You need to find [the newest Chromium package](https://pkgs.alpinelinux.org/package/edge/community/x86_64/chromium),
then look up the [supported browser version](https://pptr.dev/supported-browsers) for Puppeteer
and use the coresponding version.

**Example:**

Alpine Chromium version: `100`

Puppeteer: [Puppeteer v13.5.0](https://github.com/puppeteer/puppeteer/releases/tag/v13.5.0)

Dockerfile:

```Dockerfile
FROM alpine

# Installs Chromium (100) package.
RUN apk add --no-cache \
      chromium \
      nss \
      freetype \
      harfbuzz \
      ca-certificates \
      ttf-freefont \
      nodejs \
      yarn

...

# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

# Puppeteer v13.5.0 works with Chromium 100.
RUN yarn add puppeteer@13.5.0

# Add user so we don't need --no-sandbox.
RUN addgroup -S pptruser && adduser -S -G pptruser pptruser \
    && mkdir -p /home/pptruser/Downloads /app \
    && chown -R pptruser:pptruser /home/pptruser \
    && chown -R pptruser:pptruser /app

# Run everything after as non-privileged user.
USER pptruser

...
```

## Running Puppeteer on GitlabCI

This is very similar to some of the instructions above, but require a bit
different configuration to finally achieve success.

Usually the issue looks like this:

```bash
Error: Failed to launch chrome! spawn /usr/bin/chromium-browser ENOENT
```

You need to patch two places:

1. Your `gitlab-ci.yml` config
2. Arguments' list when launching puppeteer

In `gitlab-ci.yml` we need to install some packages to make it possible to
launch headless Chrome in your docker env:

```yml
before_script:
  - apt-get update
  - apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2
    libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4
    libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0
    libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1
    libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1
    libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release
    xdg-utils wget
```

Next, you have to use `'--no-sandbox'` mode
when launching Puppeteer. This can be done by
passing them as an arguments to your `.launch()` call:
`puppeteer.launch({ args: ['--no-sandbox'] });`.

## Running Puppeteer on Google Cloud Run

Google Cloud Run disables the CPU by default, after an HTTP response is written to the client. This means that puppeteer will appear extremely slow (taking 1-5 minutes to launch), if you "run puppeteer in the background" after your response has been written.

So this simple express app will be percievably slow:

```js
import express from 'express';

const app = express();

app.post('/test-puppeteer', (req, res) => {
  res.json({
    jobId: 123,
    acknowledged: true,
  });

  puppeteer.launch().then(browser => {
    // 2 minutes later...
  });
});

app.listen(3000);
```

It is slow because CPU is disabled on GCR because puppeteer is launched after the response is sent. What you want to do is this:

```js
app.post('/test-puppeteer', (req, res) => {
  puppeteer.launch().then(browser => {
    // A second later...
    res.json({
      jobId: 123,
      acknowledged: true,
    });
  });
});
```

If you want to run the stuff in the background, you need to "**enable CPU always**" (Go to Google Cloud Run Service > Edit & Deploy Revision > CPU allocation and pricing) even after responses are sent. That should fix it.

#### Tips

Seeing weird errors when launching Chrome? Try running your container with
`docker run --cap-add=SYS_ADMIN` when developing locally. Since the Dockerfile
adds a `pptr` user as a non-privileged user, it may not have all the necessary
privileges.

[dumb-init](https://github.com/Yelp/dumb-init) is worth checking out if you're
experiencing a lot of zombies Chrome processes sticking around. There's special
treatment for processes with PID=1, which makes it hard to terminate Chrome
properly in some cases (e.g. in Docker).

## Running Puppeteer in the cloud

### Running Puppeteer on Google App Engine

The Node.js runtime of the
[App Engine standard environment](https://cloud.google.com/appengine/docs/standard/nodejs/)
comes with all system packages needed to run Headless Chrome.

To use `puppeteer`, specify the module as a dependency in your `package.json`
and then override the puppeteer cache directory by including a file named
`.puppeteerrc.cjs` at the root of your application with the contents:

```ts
const {join} = require('path');

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  cacheDirectory: join(__dirname, 'node_modules', '.puppeteer_cache'),
};
```

> [!NOTE]
> Google App Engine caches your `node_modules` between builds.
> Specifying the Puppeteer cache as subdirectory of `node_modules`
> mitigates an issue in which Puppeteer can't find the browser executable
> due to `postinstall` not being run.

### Running Puppeteer on Google Cloud Functions

The Node.js runtime of
[Google Cloud Functions](https://cloud.google.com/functions/docs/)
comes with all system packages needed to run Headless Chrome.

To use `puppeteer`, specify the module as a dependency in your `package.json`
and then override the puppeteer cache directory by including a file named
`.puppeteerrc.cjs` at the root of your application with the contents:

```ts
const {join} = require('path');

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  cacheDirectory: join(__dirname, 'node_modules', '.puppeteer_cache'),
};
```

> [!NOTE]
> Google Cloud Functions caches your `node_modules` between builds. Specifying the
> puppeteer cache as subdirectory of `node_modules` mitigates an issue in which the
> puppeteer install process does not run when the cache is hit.

### Running Puppeteer on Google Cloud Run

The default Node.js runtime of
[Google Cloud Run](https://cloud.google.com/run/docs/) does not come with the
system packages needed to run Headless Chrome. You will need to set up your own
`Dockerfile` and
[include the missing dependencies](#chrome-doesnt-launch-on-linux).

### Running Puppeteer on Heroku

Running Puppeteer on Heroku requires some additional dependencies that aren't
included on the Linux box that Heroku spins up for you. To add the dependencies
on deploy, add the Puppeteer Heroku buildpack to the list of buildpacks for your
app under Settings > Buildpacks.

The url for the buildpack is
https://github.com/jontewks/puppeteer-heroku-buildpack

Ensure that you're using `'--no-sandbox'` mode when launching Puppeteer. This
can be done by passing it as an argument to your `.launch()` call:
`puppeteer.launch({ args: ['--no-sandbox'] });`.

When you click add buildpack, simply paste that url into the input, and click
save. On the next deploy, your app will also install the dependencies that
Puppeteer needs to run.

If you need to render Chinese, Japanese, or Korean characters you may need to
use a buildpack with additional font files like
https://github.com/CoffeeAndCode/puppeteer-heroku-buildpack

There's also another
[simple guide](https://timleland.com/headless-chrome-on-heroku/) from @timleland
that includes a sample project:
https://timleland.com/headless-chrome-on-heroku/.

### Running Puppeteer on AWS Lambda

AWS Lambda [limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)
deployment package sizes to ~50MB. This presents challenges for running headless
Chrome (and therefore Puppeteer) on Lambda. The community has put together a few
resources that work around the issues:

- https://github.com/sparticuz/chromium (a vendor and framework agnostic library that supports modern versions of `chromium`)

### Running Puppeteer on AWS EC2 instance running Amazon-Linux

If you are using an EC2 instance running amazon-linux in your CI/CD pipeline,
and if you want to run Puppeteer tests in amazon-linux, follow these steps.

1. To install Chromium, you have to first enable `amazon-linux-extras` which
   comes as part of
   [EPEL (Extra Packages for Enterprise Linux)](https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/):

   ```bash
   sudo amazon-linux-extras install epel -y
   ```

1. Next, install Chromium:

   ```bash
   sudo yum install -y chromium
   ```

Now Puppeteer can launch Chromium to run your tests. If you do not enable EPEL
and if you continue installing chromium as part of `npm install`, Puppeteer
cannot launch Chromium due to unavailability of `libatk-1.0.so.0` and many more
packages.

## Code Transpilation Issues

If you are using a JavaScript transpiler like babel or TypeScript, calling
`evaluate()` with an async function might not work. This is because while
`puppeteer` uses `Function.prototype.toString()` to serialize functions while
transpilers could be changing the output code in such a way it's incompatible
with `puppeteer`.

Some workarounds to this problem would be to instruct the transpiler not to mess
up with the code, for example, configure TypeScript to use latest ecma version
(`"target": "es2018"`). Another workaround could be using string templates
instead of functions:

```ts
await page.evaluate(`(async() => {
   console.log('1');
})()`);
```

    # WebDriver BiDi support

[WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) is a new
cross-browser automation protocol currently under development, aiming to
combine the best of both WebDriver “Classic” and CDP. WebDriver BiDi
enables bi-directional communication, making it fast by default, and it
comes packed with low-level control.

## Automate with Chrome and Firefox

Puppeteer supports WebDriver BiDi automation with Chrome and Firefox.
When launching Firefox with Puppeteer, the WebDriver BiDi Protocol is
enabled by default. When launching Chrome, CDP is still used by default
since not all CDP features are supported by WebDriver BiDi yet. If a
certain Puppeteer feature is not supported over WebDriver BiDi yet,
[`UnsupportedOperation`](https://pptr.dev/api/puppeteer.unsupportedoperation/)
error is thrown. Also see the lists below on what is supported with
WebDriver BiDi.

## Get started

Below is an example of launching Firefox or Chrome with WebDriver BiDi:

```ts
import puppeteer from 'puppeteer';

const firefoxBrowser = await puppeteer.launch({
  browser: 'firefox', // WebDriver BiDi is used by default.
});
const page = await firefoxBrowser.newPage();
...
await firefoxBrowser.close();

const chromeBrowser = await puppeteer.launch({
  browser: 'chrome',
  protocol: 'webDriverBiDi', // CDP would be used by default for Chrome.
});
const page = await chromeBrowser.newPage();
...
await chromeBrowser.close();
```

## Puppeteer features not supported over WebDriver BiDi

- Various emulations
  - Page.emulate()
  - Page.emulateCPUThrottling()
  - Page.emulateIdleState()
  - Page.emulateMediaFeatures()
  - Page.emulateMediaType()
  - Page.emulateVisionDeficiency()
  - Page.setBypassCSP()

- CDP-specific features
  - HTTPRequest.client()
  - HTTPRequest.resourceType()
  - Page.createCDPSession()

- Accessibility
- Coverage
- Tracing

- Other methods:
  - Frame.waitForDevicePrompt()
  - HTTPResponse.buffer()
  - HTTPResponse.content()
  - HTTPResponse.text()
  - HTTPResponse.fromServiceWorker()
  - HTTPResponse.securityDetails()
  - Input.drag()
  - Input.dragAndDrop()
  - Input.dragOver()
  - Input.drop()
  - Page.emulateNetworkConditions()
  - Page.isDragInterceptionEnabled()
  - Page.isServiceWorkerBypassed()
  - Page.metrics()
  - Page.queryObjects()
  - Page.screencast()
  - Page.setBypassServiceWorker()
  - Page.setDragInterception()
  - Page.setOfflineMode()
  - Page.waitForDevicePrompt()
  - PageEvent.popup

## Puppeteer features fully supported over WebDriver BiDi

- Browser automation
  - Browser.close()
  - Browser.userAgent()
  - Browser.version()
  - Puppeteer.launch()

- Page automation
  - Frame.goto() (except `referer` and `referrerPolicy`)
  - Page 'popup' event
  - Page.bringToFront()
  - Page.cookies()
  - Page.deleteCookie()
  - Page.goBack()
  - Page.goForward()
  - Page.goto (except `referer` and `referrerPolicy`)
  - Page.reload (except for `ignoreCache` parameter)
  - Page.setCacheEnabled()
  - Page.setCookie()
  - Page.setExtraHTTPHeaders()
  - Page.setGeolocation()
  - Page.setViewport (`width`, `height`, `deviceScaleFactor` only)
  - Page.waitForFileChooser()
  - Page.workers()
  - PageEvent.WorkerCreated
  - PageEvent.WorkerDestroyed
  - Target.opener()

- [Script evaluation](https://pptr.dev/guides/evaluate-javascript):
  - JSHandle.evaluate()
  - JSHandle.evaluateHandle()
  - Page.evaluate()
  - Page.evaluateOnNewDocument()
  - Page.exposeFunction()

- [Selectors](https://pptr.dev/guides/query-selectors) and [locators](https://pptr.dev/guides/locators) except for ARIA:
  - Page.$
  - Page.$$
  - Page.$$eval
  - Page.$eval
  - Page.waitForSelector
  - Page.locator() and all locator APIs

- Input
  - ElementHandle.click
  - ElementHandle.uploadFile
  - Keyboard.down
  - Keyboard.press
  - Keyboard.sendCharacter
  - Keyboard.type
  - Keyboard.up
  - Mouse events (except for dedicated drag'n'drop API methods)
  - Page.tap
  - TouchScreen.\*

- JavaScript dialog interception
  - page.on('dialog')
  - Dialog.\*

- Screenshots (not all parameters are supported)
  - Page.screenshot (supported parameters are `clip`, `encoding`, `fullPage`)

- PDF generation (not all parameters are supported)
  - Page.pdf (only `format`, `height`, `landscape`, `margin`, `pageRanges`, `printBackground`, `scale`, `width` are supported)
  - Page.createPDFStream (only `format`, `height`, `landscape`, `margin`, `pageRanges`, `printBackground`, `scale`, `width` are supported)

- Permissions
  - BrowserContext.clearPermissionOverrides()
  - BrowserContext.overridePermissions()

- Various emulations
  - Page.emulateTimezone()
  - Page.isJavaScriptEnabled()
  - Page.setJavaScriptEnabled()

- [Request interception](https://pptr.dev/guides/request-interception)
  - HTTPRequest.abort() (no custom error support)
  - HTTPRequest.abortErrorReason()
  - HTTPRequest.continue()
  - HTTPRequest.continueRequestOverrides()
  - HTTPRequest.failure()
  - HTTPRequest.finalizeInterceptions()
  - HTTPRequest.interceptResolutionState()
  - HTTPRequest.isInterceptResolutionHandled()
  - HTTPRequest.respond()
  - HTTPRequest.responseForRequest()
  - Page.authenticate()
  - Page.setRequestInterception()
  - Page.setUserAgent()

## See also

- [WebDriver BiDi - The future of cross-browser automation](https://developer.chrome.com/articles/webdriver-bidi/)
- [WebDriver BiDi: 2023 status update](https://developer.chrome.com/blog/webdriver-bidi-2023/)
- [Puppeteer Support for the Cross-Browser WebDriver BiDi Standard](https://hacks.mozilla.org/2023/12/puppeteer-webdriver-bidi/)