viewport_resize
Resize the Chrome browser window to preset mobile, tablet, or desktop dimensions or specify custom pixel sizes. Also retrieve the current viewport size.
Instructions
Resize the Chrome window to a preset (mobile 375x812, tablet 768x1024, desktop 1440x900) or explicit dimensions; the viewport is smaller by the browser chrome, action=get reports the real one. width/height override half a preset. 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 | |
| zoom | No | Page zoom for this origin, 1 = 100%; applied after the resize | |
| 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 |