View-source screenshot
view_source_screenshotFetch a page's raw HTML as a browser does, render it view-source style with line numbers, highlight matching text or lines, and save a PNG while returning the file path and matched lines.
Instructions
Fetch a page's raw HTML the way a browser does, render it like Chrome's view-source (line numbers, monospace), highlight matches and save a PNG. Returns the file path and the matched lines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Output PNG path. Defaults to ~/Desktop/vsource-<host-path>-<time>.png. | |
| url | Yes | Page URL to read the raw HTML source of. | |
| mode | No | "matches" (default) shows only the highlighted lines plus context, with long gaps collapsed; "first" is one viewport of the full source scrolled to the first match. | |
| label | No | Suffix for the default filename, e.g. "before" or "after". | |
| lines | No | Line numbers to highlight in full. | |
| match | No | Text to highlight. Plain text also matches its JSON-escaped form (/ as \/). Prefix with "re:" for a regex. | |
| width | No | Viewport width in px (default 1366). | |
| hide_params | No | Query parameter names to keep out of the view-source header (they are still sent with the request), e.g. preview or auth tokens. | |
| context_lines | No | Lines of context above and below the matches (default 4). |