set_device_emulation
Emulate Apple device viewports, pixel ratios, and touch support in Safari DevTools using presets or custom values.
Instructions
Emulate an Apple device by resizing the viewport and overriding device pixel ratio and touch support at the JS level. The user agent is overridden via navigator.userAgent (JS-level only — HTTP request headers are not affected). Choose a preset (iPhone SE, iPhone 14, iPhone 15 Pro, iPhone 16 Pro Max, iPad Mini, iPad Air, iPad Pro 11, iPad Pro 13) or provide custom values. Use reset_device_emulation to restore defaults.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | Viewport width in CSS pixels. | |
| device | No | Apple device preset name. Overrides width/height/dpr/userAgent if provided. | |
| height | No | Viewport height in CSS pixels. | |
| userAgent | No | Custom user agent string (JS-level override only; HTTP headers unchanged). | |
| devicePixelRatio | No | Device pixel ratio (e.g. 2 for Retina). |