viewport_resize
Resize the Chrome window to mobile, tablet, or desktop presets, or set custom dimensions to test responsive layouts. Also reports the current viewport size.
Instructions
Resize the Chrome window to a preset (mobile 375x812, tablet 768x1024, desktop 1440x900) or to explicit dimensions. The rendered viewport ends up smaller than what you ask for, by the height of the browser chrome — measure it with execute_js if the exact number matters. width and height each override the corresponding half of the preset, so preset plus width gives a custom width at the preset height. A maximized window on ChromeOS ignores the request.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Window y on the virtual desktop | |
| left | No | Window x on the virtual desktop; on multi-monitor this is what picks the screen | |
| state | No | Applied before bounds: a maximized window accepts left/top/width/height and ignores them | |
| width | No | Overrides preset | |
| action | No | get reports the current viewport without resizing anything | set |
| height | No | Overrides preset | |
| preset | No | 375x812, 768x1024, 1440x900 | |
| tab_id | No | Target tab; omitted = last tab navigated in this session, else the active one |