Skip to content

page-state

Query webview page state: URL, title, viewport, scroll position, document size, and Tauri detection.

Bridge Required

This command requires an active bridge connection.

Usage

tauri-agent-tools page-state [options]

Options

Option Description Default
--json Output as JSON
--port <number> Bridge port (auto-discover if omitted)
--token <string> Bridge token (auto-discover if omitted)

Examples

Text output

tauri-agent-tools page-state
URL:             http://localhost:1420/
Title:           My Tauri App
Viewport:        1920x1080
Scroll Position: 0, 0
Document Size:   1920x2400
Tauri:           yes

JSON output

tauri-agent-tools page-state --json
{
  "url": "http://localhost:1420/",
  "title": "My Tauri App",
  "viewport": { "width": 1920, "height": 1080 },
  "scroll": { "x": 0, "y": 0 },
  "document": { "width": 1920, "height": 2400 },
  "hasTauri": true
}

Notes

  • viewport shows window.innerWidth / window.innerHeight
  • document shows document.documentElement.scrollWidth / scrollHeight
  • hasTauri indicates whether window.__TAURI__ is defined
  • Useful for checking the webview state before taking screenshots or running other commands