Overlay.highlightRectHighlights given rectangle. Coordinates are absolute with respect to the main frame viewport. Issue: the method does not handle device pixel ratio (DPR) correctly. The coordinates currently have to be adjusted by the client if DPR is not 1 (see crbug.com/437807128).
| Name | Type | Description |
|---|---|---|
x | integer | X coordinate |
y | integer | Y coordinate |
width | integer | Rectangle width |
height | integer | Rectangle height |
color (optional) | DOM.RGBA | The highlight fill color (default: transparent). |
outlineColor (optional) | DOM.RGBA | The highlight outline color (default: transparent). |
{
"id": 1,
"method": "Overlay.highlightRect",
"params": {
"x": 100,
"y": 100,
"width": 1280,
"height": 720
}
}
{
"id": 1,
"result": {}
}
const result = await send('Overlay.highlightRect', {"x": 100, "y": 100, "width": 1280, "height": 720});
console.log(result);