--- name: webperf-media description: Intelligent media optimization with automated workflows for images, videos, and SVGs. Includes decision trees that detect LCP images (triggers format/lazy-loading/priority analysis), identify layout shift risks (missing dimensions), and flag lazy loading issues (above-fold lazy or below-fold eager). Features workflows for complete media audit, LCP image investigation, video performance (poster optimization), and SVG embedded bitmap detection. Cross-skill integration with Core Web Vitals (LCP/CLS impact) and Loading (priority hints, resource preloading). Provides performance budgets and format recommendations based on content type. Use when the user asks about image optimization, LCP is an image/video, layout shifts from media, or media loading strategy. Compatible with Chrome DevTools MCP. --- # WebPerf: Media Performance JavaScript snippets for measuring web performance in Chrome DevTools. Execute with `mcp__chrome-devtools__evaluate_script`, capture output with `mcp__chrome-devtools__get_console_message`. ## Available Snippets | Snippet | Description | File | |---------|-------------|------| | Image Element Audit | Audits all elements on the page against image performance best practices — covering loading st | scripts/Image-Element-Audit.js | | SVG Embedded Bitmap Analysis | Scans all SVG resources on the page — both external files and inline elements — and flags any | scripts/SVG-Embedded-Bitmap-Analysis.js | | Video Element Audit | Audits all elements on the page against image performance best practices — covering loading strategy, fetch priority, format modernisation, responsive markup, and CLS prevention. **Script:** `scripts/Image-Element-Audit.js` --- ## SVG Embedded Bitmap Analysis Scans all SVG resources on the page — both external files and inline elements — and flags any that contain embedded bitmap images, reporting name, transfer size, compression encoding, and embedded bitmap details. **Script:** `scripts/SVG-Embedded-Bitmap-Analysis.js` --- ## Video Element Audit Audits all