Skip to main content
The Get Page Rectangle command (Command Type: 20) retrieves the bounding rectangle (width, height, and position) of the current browser page.

Command Type

Command Type ID: 20

Parameters

ParameterTypeDescriptionRequired
timeoutnumberTimeout in millisecondsYes

Usage Examples

Get Page Dimensions

{
  "command": "get-page-rectangle",
  "params": {
    "timeout": 5000
  }
}

Common Use Cases

  • Viewport Awareness: Determine page size before calculating element positions
  • Scroll Calculations: Use page dimensions to calculate scroll targets