Default viewport
If theviewport parameter is omitted when creating a browser, the default configuration is 1920x1080 at 25Hz.
Setting viewport configuration
You can configure the viewport when creating a browser by specifying theviewport parameter with width and height. The refresh_rate is optional and will be automatically determined from the dimensions if they match a supported configuration:
The
refresh_rate parameter only applies to live view sessions and is ignored for headless browsers.Supported viewport configurations
Kernel supports specific viewport configurations. The server will reject unsupported combinations. When you provide width and height without specifying refresh_rate, it will be automatically determined if the dimensions match one of the supported resolutions exactly. The following resolutions are supported:| Resolution | Width | Height | Refresh Rate |
|---|---|---|---|
| QHD | 2560 | 1440 | 10 Hz |
| Full HD | 1920 | 1080 | 25 Hz |
| WUXGA | 1920 | 1200 | 25 Hz |
| WXGA+ | 1440 | 900 | 25 Hz |
| WXGA | 1200 | 800 | 25 Hz |
| XGA | 1024 | 768 | 60 Hz |
Example configurations
Viewport constraints
Only the specific viewport configurations listed in the supported configurations table above are supported:- 2560x1440 (QHD) at 10 Hz
- 1920x1080 (Full HD) at 25 Hz
- 1920x1200 (WUXGA) at 25 Hz
- 1440x900 (WXGA+) at 25 Hz
- 1200x800 (WXGA) at 25 Hz
- 1024x768 (XGA) at 60 Hz
- Width and Height are required and must match one of the supported configurations exactly
- Refresh Rate is optional - if omitted, it will be automatically determined from the width and height combination
Considerations
- The viewport configuration is set when the browser is created and applies to the initial browser window
- Higher resolutions (like 2560x1440) may impact the performance and responsiveness of live view sessions
- The viewport size affects how websites render, especially those with responsive designs
- Screenshots taken from the browser will match the configured viewport dimensions
- In headless mode, the viewport width and height still apply for rendering and screenshots, but the
refresh_rateparameter is ignored

