Skip to content

Commit

Permalink
(imp) puppeteer 22.0.0 .. 22.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-pelykh committed Dec 18, 2024
1 parent effa8cc commit 40fb0b5
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 290 deletions.
65 changes: 17 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- lts/jod

env:
PUPPETEER_VERSION: 21.11.0
PUPPETEER_VERSION: 22.15.0

steps:

Expand Down Expand Up @@ -82,53 +82,22 @@ jobs:
- ubuntu-latest
- windows-latest
puppeteer-version:
- '18.2.1'
- '19.0.0'
- '19.1.1' # NOTE: Should've been 19.1.2 but there's no puppeteer-core@19.1.2
- '19.2.2'
- '19.3.0'
- '19.4.1'
- '19.5.2'
- '19.6.3'
- '19.7.5'
- '19.8.5'
- '19.9.1'
- '19.10.1'
- '19.11.1'
- '20.0.0'
- '20.1.2'
- '20.2.1'
- '20.3.0'
- '20.4.0'
- '20.5.0'
- '20.6.0'
- '20.7.4'
- '20.8.3'
- '20.9.0'
- '21.0.3'
- '21.1.1'
- '21.2.1'
# - '21.3.0' # NOTE: Puppeteer v21.3.0 with Chrome r117.0.5938.88 reacts with "targetCrashed"
# - '21.3.1' # NOTE: Puppeteer v21.3.1 with Chrome r117.0.5938.88 reacts with "targetCrashed"
# - '21.3.2' # NOTE: Puppeteer v21.3.2 with Chrome r117.0.5938.92 reacts with "targetCrashed"
# - '21.3.3' # NOTE: Puppeteer v21.3.3 with Chrome r117.0.5938.92 reacts with "targetCrashed"
# - '21.3.4' # NOTE: Puppeteer v21.3.4 with Chrome r117.0.5938.92 reacts with "targetCrashed"
# - '21.3.5' # NOTE: Puppeteer v21.3.5 with Chrome r117.0.5938.92 reacts with "targetCrashed"
# - '21.3.6' # NOTE: Puppeteer v21.3.6 with Chrome r117.0.5938.92 reacts with "targetCrashed"
# - '21.3.7' # NOTE: Puppeteer v21.3.7 with Chrome r117.0.5938.149 reacts with "targetCrashed"
# - '21.3.8' # NOTE: Puppeteer v21.3.8 with Chrome r117.0.5938.149 reacts with "targetCrashed"
# - '21.4.0' # NOTE: Puppeteer v21.4.0 with Chrome r118.0.5993.70 reacts with "targetCrashed"
# - '21.4.1' # NOTE: Puppeteer v21.4.1 with Chrome r118.0.5993.70 reacts with "targetCrashed"
# - '21.5.0' # NOTE: Puppeteer v21.5.0 with Chrome r119.0.6045.105 reacts with "targetCrashed"
# - '21.5.1' # NOTE: Puppeteer v21.5.1 with Chrome r119.0.6045.105 reacts with "targetCrashed"
# - '21.5.2' # NOTE: Puppeteer v21.5.2 with Chrome r119.0.6045.105 reacts with "targetCrashed"
# - '21.6.0' # NOTE: Puppeteer v21.6.0 with Chrome r119.0.6045.105 reacts with "targetCrashed"
# - '21.6.1' # NOTE: Puppeteer v21.6.1 with Chrome r119.0.6045.105 reacts with "targetCrashed"
# - '21.7.0' # NOTE: Puppeteer v21.7.0 with Chrome r119.0.6045.105 reacts with "targetCrashed"
# - '21.8.0' # NOTE: Puppeteer v21.8.0 with Chrome r120.0.6099.109 reacts with "targetCrashed"
- '21.9.0'
- '21.10.0'
- '21.11.0'
- '22.0.0'
- '22.1.0'
- '22.2.0'
- '22.3.0'
- '22.4.1'
- '22.5.0'
- '22.6.5'
- '22.7.1'
- '22.8.2'
- '22.9.0'
- '22.10.1'
- '22.11.2'
- '22.12.1'
- '22.13.1'
- '22.14.0'
- '22.15.0'

steps:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
package:
runs-on: ubuntu-latest
env:
PUPPETEER_VERSION: 21.11.0
PUPPETEER_VERSION: 22.15.0
steps:

- name: Checkout
Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const { capture, launch } = require('puppeteer-capture')
waitUntil: 'networkidle0',
})
await recorder.start('capture.mp4')
await page.waitForTimeout(1000)
await recorder.waitForTimeout(1000)
await recorder.stop()
await recorder.detach()
await browser.close()
Expand All @@ -43,11 +43,16 @@ The browser is running in a deterministic mode, thus the time flow is not real t
time within the page's timeline, `PuppeteerCapture.waitForTimeout()` must be used:

```js
await page.waitForTimeout(1000)
await recorder.waitForTimeout(1000)
```

## Known Issues

### `--headless=new` is not supported

Sadly, [it is so](https://issues.chromium.org/issues/361863270#comment2). Starting with Puppeteer v22, `--headless=new`
is used by default so the plugin overrides with `--headless=shell`.

### Bad Chrome versions

- `117.0.5938.88` (default for `puppeteer` version(s) `21.3.0` ): reacts with `targetCrashed`
Expand All @@ -72,7 +77,7 @@ The exact origin of the issue is not yet known, yet it's likely to be related to

Calling `page.setViewport()` before starting the capture behaves the same, yet calling it _after_ starting the capture
works yet not always. Thus it's safe to assume that there's some sort of race condition, since adding
`page.waitForTimeout(100)` just before setting the viewport workarounds the issue.
`recorder.waitForTimeout(100)` just before setting the viewport workarounds the issue.

Also it should be taken into account that since frame size is going to change over the time of the recording, frame size
autodetection will fail. To workaround this issue, frame size have to be specified:
Expand All @@ -81,8 +86,8 @@ autodetection will fail. To workaround this issue, frame size have to be specifi
const recorder = await capture(page, {
size: `${viewportWidth}x${viewportHeight}`,
})
await recorder.start('capture.mp4', { waitForTimeout: false })
await page.waitForTimeout(100)
await recorder.start('capture.mp4', { waitForFirstFrame: false })
await recorder.waitForTimeout(100)
await page.setViewport({
width: viewportWidth,
height: viewportHeight,
Expand All @@ -105,15 +110,6 @@ await page.setViewport({
})
```

### `waitForTimeout()` won't work

The `Page.waitForTimeout()` method implementation essentially forwards the call to the `Frame.waitForTimeout()` on the
`page.mainFrame()`. The latter is implemented via `setTimeout()`, thus can not work in deterministic mode at all.

To workaround this issue, there's a `PuppeteerCapture.waitForTimeout()` that waits for the timeout in the timeline of
the captured page, which is not real time at all. For convenience, while capturing is active, the page's
`waitForTimeout()` becomes a wrapper for `PuppeteerCapture.waitForTimeout()`.

### Multiple `start()`/`stop()` fail

It's unclear why, yet after disabling and re-enabling the capture, callbacks from browser stop arriving.
Expand Down
Loading

0 comments on commit 40fb0b5

Please sign in to comment.