Emulate device metrics (size / DPR / mobile)
emulate_deviceOverride viewport size, device pixel ratio, and mobile mode for responsive testing while keeping coordinate math stable on scaled displays; clear the override per tab when done.
Instructions
Override viewport size, device pixel ratio, and mobile flag (CDP Emulation) for responsive testing — also stabilizes coordinate math on scaled displays. The override persists for the tab until reset:true (or its debugger detaches).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tabId": "<tabId>"
},
"name": "emulate_device"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reset | No | Clear the override | |
| tabId | Yes | Target tab ID (must be in the MCP group) | |
| width | No | Viewport width in px (1-10000) | |
| height | No | Viewport height in px (1-10000) | |
| mobile | No | Mobile mode (default false) | |
| deviceScaleFactor | No | Device pixel ratio (default 1) |