mirror of
https://github.com/lexmount/moli.git
synced 2026-10-02 00:00:49 +00:00
docs(skills): document full-page screenshots
This commit is contained in:
@@ -54,6 +54,28 @@ hard-coding a `/devtools/...` path.
|
||||
- Add `--block-private-networks` or `--block-cidrs` for untrusted navigation.
|
||||
- Keep loopback binding unless remote clients genuinely require exposure.
|
||||
|
||||
## Full-document screenshots
|
||||
|
||||
With `--layout`, request an automatic full-document PNG by omitting `clip` and
|
||||
setting `captureBeyondViewport`:
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "Page.captureScreenshot",
|
||||
"params": { "format": "png", "captureBeyondViewport": true }
|
||||
}
|
||||
```
|
||||
|
||||
- Automatic full-document capture requires CSS width and height to each be less
|
||||
than 131,072 pixels; equality is rejected.
|
||||
- An explicit page-coordinate `clip` bypasses that whole-document entry check,
|
||||
but must have positive dimensions.
|
||||
- Moli renders one complete bitmap. It does not stitch tiles or automatically
|
||||
downscale, so device-pixel, encoder, backend, and memory limits can fail
|
||||
earlier than the CSS boundary.
|
||||
- Tile explicit clips in the client when one bitmap cannot fit. Keep each clip
|
||||
within the active raster and encoder limits.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
1. Confirm the Moli process is still running.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: moli-webfetch
|
||||
description: Fetch, inspect, crawl, and capture live, JavaScript-rendered websites with Moli. Use when Codex needs current web content, web research, fact lookup, link following, a bounded crawl, client-rendered or response-gated content, network diagnostics, or a standalone HTML, Markdown, JSON, semantic-tree, screenshot, PDF, or WPT artifact—even when Moli is not named.
|
||||
description: Fetch, inspect, crawl, and capture live, JavaScript-rendered websites with Moli. Use when Codex needs current web content, web research, fact lookup, link following, a bounded crawl, client-rendered or response-gated content, network diagnostics, or a standalone HTML, Markdown, JSON, semantic-tree, viewport or full-document screenshot, PDF, or WPT artifact—even when Moli is not named.
|
||||
---
|
||||
|
||||
# Fetch Websites with Moli
|
||||
@@ -66,7 +66,8 @@ structure-first; enable layout only when the result needs pixels or pagination.
|
||||
6. For a visual or paginated result, enable layout and redirect binary stdout:
|
||||
|
||||
```bash
|
||||
moli fetch --layout --dump screenshot "https://example.com" > page.png
|
||||
moli fetch --layout --dump screenshot "https://example.com" > viewport.png
|
||||
moli fetch --layout --dump screenshot_full "https://example.com" > full-page.png
|
||||
moli fetch --layout --dump pdf "https://example.com" > page.pdf
|
||||
```
|
||||
|
||||
@@ -85,6 +86,7 @@ structure-first; enable layout only when the result needs pixels or pagination.
|
||||
- Use `html` to diagnose DOM serialization or preserve exact markup.
|
||||
- Use `screenshot` for a viewport PNG when appearance is evidence. It requires
|
||||
`--layout`.
|
||||
- Use `screenshot_full` for one full-document PNG. It requires `--layout`.
|
||||
- Use `pdf` for a paginated PDF capture. It requires `--layout`.
|
||||
- Use `--with-frames` only when relevant content lives inside iframes.
|
||||
- Enable `--image` and `--font` when visual fidelity depends on them. Use
|
||||
@@ -121,9 +123,9 @@ unrelated actions.
|
||||
to use. Never expose headers, cookies, or tokens in the response.
|
||||
- Remember that `-H/--header` applies to the initial navigation, not every
|
||||
subresource.
|
||||
- Treat stdout as the requested artifact. Redirect screenshot and PDF output to
|
||||
files, verify that they are non-empty and have the expected type, and never
|
||||
print their binary bytes into a text response.
|
||||
- Treat stdout as the requested artifact. Redirect screenshot, full-document
|
||||
screenshot, and PDF output to files, verify that they are non-empty and have
|
||||
the expected type, and never print their binary bytes into a text response.
|
||||
- Report a fetch failure rather than inventing content. A browser error page,
|
||||
login wall, or empty shell is not successful evidence.
|
||||
- Run `moli fetch --help` when the installed version may differ from this
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
| Inspect exact DOM | `--dump html` | Useful when Markdown loses important structure |
|
||||
| Diagnose requests | `--dump json --trace-network` | Adds the `network` object |
|
||||
| Capture the viewport | `--layout --dump screenshot` | Writes PNG bytes to stdout |
|
||||
| Capture the full document | `--layout --dump screenshot_full` | Writes one full-page PNG to stdout |
|
||||
| Capture a paginated document | `--layout --dump pdf` | Writes PDF bytes to stdout |
|
||||
|
||||
Raw non-HTML responses support only `html` and `json`.
|
||||
@@ -88,13 +89,18 @@ silently remove behavior or content.
|
||||
|
||||
## Screenshots and PDFs
|
||||
|
||||
Enable real on-demand layout for both binary formats and redirect stdout:
|
||||
Enable real on-demand layout for binary output and redirect stdout:
|
||||
|
||||
```bash
|
||||
moli fetch \
|
||||
--layout \
|
||||
--dump screenshot \
|
||||
"https://example.com" > page.png
|
||||
"https://example.com" > viewport.png
|
||||
|
||||
moli fetch \
|
||||
--layout \
|
||||
--dump screenshot_full \
|
||||
"https://example.com" > full-page.png
|
||||
|
||||
moli fetch \
|
||||
--layout \
|
||||
@@ -102,6 +108,11 @@ moli fetch \
|
||||
"https://example.com" > page.pdf
|
||||
```
|
||||
|
||||
Use `screenshot` for the live viewport and `screenshot_full` for one complete
|
||||
document raster. A full-document capture does not tile or automatically
|
||||
downscale: its CSS width and height must each be less than 131,072 pixels, and
|
||||
device-pixel, encoder, memory, or backend limits can fail earlier.
|
||||
|
||||
Use `--image --font` when page appearance depends on external images or fonts.
|
||||
Use `--resource` only when every optional resource family is needed. Keep stderr
|
||||
separate from the output file, then validate the file signature and size.
|
||||
@@ -158,6 +169,8 @@ For a crawl rather than a single lookup:
|
||||
- **Missing API data:** use response waits; add `--trace-network` to JSON only
|
||||
when request diagnostics are needed. Add `--trace-matched-response-body` only
|
||||
when the matched response body itself is required.
|
||||
- **Oversized full-page PNG:** use a viewport capture or deliberately tiled CDP
|
||||
clips when one `screenshot_full` raster exceeds a backend or memory boundary.
|
||||
- **TLS failure:** fix trust or hostname configuration. Use
|
||||
`--insecure-disable-tls-host-verification` only after the user explicitly
|
||||
accepts that risk.
|
||||
|
||||
Reference in New Issue
Block a user