GoogleChrome / GoogleChrome/lighthouse
Feature: LLM/AI-friendly compact JSON output (omit embedded base64 screenshots)
- Dominant language
- JavaScript
- Stars
- 30.8k
- Forks
- 9.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 20
Description
### Summary
Lighthouse JSON reports embed large base64-encoded images that dominate the file size and make the report impractical to feed into an LLM/AI assistant. With AI-assisted development now common, developers routinely paste Lighthouse output into a prompt to get help interpreting and fixing issues, but the embedded images blow past context/token limits and get truncated, while carrying no value for textual or programmatic analysis.
### Where the weight is
In the `lhr`, the bulk of the bytes come from a few audits:
- `audits["screenshot-thumbnails"].details.items[].data` — the filmstrip (~6-10 base64 JPEG frames)
- `audits["final-screenshot"].details.data` — one base64 JPEG
- `audits["full-page-screenshot"].screenshot.data` — one large base64 JPEG
These are typically **90-98% of the report**, while the actionable payload (metric `score`/`numericValue`/`displayValue`, opportunity `details.items`, diagnostics, and LCP/element `node.snippet`/`node.selector`) is a few KB.
### Request
A first-class way to emit a structurally valid but image-free report, e.g.:
- a flag like `--output=json --no-base64-screenshots` (or `--output=json-compact`), and/or
- a settings option (`settings.omitScreenshotData: true`)
that strips/redacts the base64 `data` fields above (optionally replacing them with metadata only: dimensions + timing + an `"omitted": true` marker) while keeping everything else intact.
### Why this isn't covered today
`--only-audits` / `skipAudits` change *what is measured*, not how the retained audits are serialized — you still get the heavy media inside the audits you keep. There is no clean "keep all metrics, drop the heavy media payloads" switch.
### Current workaround (please consider promoting to a built-in)
```bash
lighthouse --output=json --quiet \
| jq 'del(.audits["screenshot-thumbnails"], .audits["final-screenshot"], .audits["full-page-screenshot"], .fullPageScreenshot)'
```
This routinely shrinks a multi-hundred-KB / multi-MB report to a few KB of pure, paste-into-a-prompt signal.
### Benefit
Smaller CI artifacts, cleaner diffs, and — increasingly important — Lighthouse output that can be handed directly to an AI assistant for performance debugging without truncation.
Possibly related: https://issues.chromium.org/issues/364805393
Contributor guide
Research direction
Start with Lighthouse's `--output=json` CLI path and the proposed `settings.omitScreenshotData` option, then inspect the listed `lhr` audit locations: `screenshot-thumbnails`, `final-screenshot`, `full-page-screenshot`, and `fullPageScreenshot`. Done means the report remains structurally valid, preserves the actionable metrics and metadata, and omits or marks the base64 image data without requiring the `jq` workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100