page_set_viewport
Resize the browser viewport of an active session to match your target device, ensuring correct rendering and interaction for responsive or mobile-first testing.
Instructions
Resize an existing session's viewport without relaunching. Use a portrait size (e.g. {width:390,height:844}) for canvas/WebGL games so the game fills the screen and page_click_at coordinates land on it. Keep hasTouch:false (default) so mouse clicks drive the game; set hasTouch:true only for games that require touch input.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| device | No | preset: "mobile" = 390x844 dpr3 phone (+mobile UA), "desktop" = 1280x800. Overridden by explicit width/height. | |
| height | No | ||
| mobile | No | emulate a mobile device (default false) | |
| hasTouch | No | emulate touch input (default false; mouse clicks won't drive touch-only games) | |
| sessionId | No | ||
| deviceScaleFactor | No |