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:
Setting a custom viewport configuration triggers a Chromium restart, which can take several seconds. Use browser pools to access browsers with custom viewport configurations faster.
The
refresh_rate parameter only applies to live view sessions and is ignored for headless browsers.Window size vs. page viewport
Theviewport parameter sets the dimensions of the browser window, not the visible page area. On headful browsers, Chromium’s UI (tab strip and toolbar) occupies part of the window height, so the page renders in a slightly shorter area than the configured height. For example, with a 1280x800 viewport, window.innerHeight will be less than 800 and content near the bottom of the page may not be visible in screenshots or live view.
If your automation expects an exact page viewport, either:
- Set the page viewport through your automation framework, which controls the rendered page size directly regardless of the window dimensions:
- Account for the browser UI when choosing dimensions by adding its height to the
heightyou pass to Kernel, so the remaining page area matches your target size.
Supported viewport configurations
Kernel supports specific viewport configurations tuned for optimal performance and Computer Use compatibility. 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:
When specifying a viewport:
- Width and Height are required
- Viewport configurations outside of the supported list are available, but they are provided on a “use at your own risk” basis and may not work as expected.
- Refresh Rate is optional - if omitted, it will be automatically determined from the width and height combination
Example configurations
Dynamically changing the viewport
You can change the viewport of a browser after it has been created using the update browser endpoint.Force resizing during recording
If you need to resize the viewport while a replay is actively recording, setforce 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.
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 through your automation framework capture the page viewport, which on headful browsers is shorter than the configured dimensions due to the browser UI (see Window size vs. page viewport)