ios_safari_get_dom
Get the outer HTML of a Safari page (or a CSS-selector-matched element) on an iOS device via the Web Inspector. Executes document.documentElement.outerHTML, or document.querySelector(selector)?.outerHTML when a selector is provided. Output is capped at 100 000 characters; a truncation notice is appended when the limit is hit. Omit pageId to auto-pick the active Safari page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | iOS device UDID | |
| pageId | No | CDP target id from ios_safari_list_pages. Omit it to use the page ios_safari_navigate last landed on (or, failing that, the first loaded page) — only pass it to target a DIFFERENT tab | |
| selector | No | Optional CSS selector — returns outerHTML of the first matching element, or null if not found | |
| platformVersion | No | Ignored (kept for compatibility) |