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
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
URL: http://localhost:1420/
Title: My Tauri App
Viewport: 1920x1080
Scroll Position: 0, 0
Document Size: 1920x2400
Tauri: yes
JSON output
{
"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
viewportshowswindow.innerWidth/window.innerHeightdocumentshowsdocument.documentElement.scrollWidth/scrollHeighthasTauriindicates whetherwindow.__TAURI__is defined- Useful for checking the webview state before taking screenshots or running other commands