set_device
Switch browser device emulation to mobile or desktop mode using presets or custom viewport, user agent, and touch settings while preserving cookies and localStorage.
Instructions
Switch browser device emulation between mobile and desktop modes. Recreates the browser context with new viewport, user agent, and touch settings. Cookies and localStorage are preserved. Use preset device names for convenience or provide custom parameters. Returns page_state showing the page as rendered in the new device mode. Cannot be used while sub-agents are running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | No | Device preset name: 'iphone_15', 'iphone_se', 'iphone_15_pro_max', 'pixel_7', 'galaxy_s24', 'ipad_pro', 'ipad', 'galaxy_tab_s9', 'desktop', 'desktop_hd'. Use 'desktop' to reset to default mode. Cannot be combined with custom fields. | |
| hasTouch | No | Enable touch event support. Cannot be used with 'device'. | |
| isMobile | No | Enable mobile viewport behavior. Cannot be used with 'device'. | |
| viewport | No | Custom viewport dimensions. Cannot be used with 'device'. | |
| userAgent | No | Custom user agent string. Cannot be used with 'device'. | |
| deviceScaleFactor | No | Device pixel ratio (e.g., 2 for retina, 3 for iPhone). Cannot be used with 'device'. |