Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions browsers/viewport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,14 @@ await kernel.browsers.update(kernel_browser.session_id, viewport={"width": 1024,

<Warning>
There are important limitations when changing the viewport:
- **Headful browsers**: You can't resize the viewport while [live view](/browsers/live-view) is active or while a [replay](/browsers/replays) is actively recording unless you set the `force` flag to `true`.
- **Headful browsers with live view active**: You can't resize the viewport while [live view](/browsers/live-view) is connected.
- **Headful browsers with replay recording active**: You can't resize the viewport while a [replay](/browsers/replays) is actively recording unless you set `viewport.force` to `true`.
- **Headless browsers**: Changing the viewport triggers a Chromium restart, which takes several seconds and may disrupt active CDP connections.
</Warning>

### Force resizing during recording
### Force resizing during replay recording

If you need to resize the viewport while a replay is actively recording, set `force` to `true` in the update request. This stops the current recording, resizes the viewport, and restarts the recording — resulting in multiple replay segments for the session.
If you need to resize the viewport while a replay is actively recording, set `force` to `true` in the update request. This stops the current replay recording, resizes the viewport, and starts a new replay recording segment for the same session.

<CodeGroup>
```typescript Typescript/Javascript
Expand Down