extension-perf-forensics

Diagnose extension-caused memory leaks, freezes, and CPU storms on live websites via CDP metrics and heap snapshots.

9.4k|668|Updated Apr 16, 2025
One-click install
npx skills add https://github.com/mengxi-ream/read-frog --skill extension-perf-forensics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extension-perf-forensics
Source: https://github.com/mengxi-ream/read-frog/tree/main/.agents/skills/extension-perf-forensics
Command: npx skills add https://github.com/mengxi-ream/read-frog --skill extension-perf-forensics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires puppeteer, memlab, and includes references (resource) components.

What problem does it solve?

When users report that a browser extension makes a page leak memory, freeze, or burn CPU, it is hard to tell whether the extension or the site itself is at fault. This Skill turns vague performance complaints into measured, attributed root causes with reproducible pass/fail numbers.

Core Features & Use Cases

  • Attribution ladder experiments: Run controlled comparisons (no-extension baseline, extension-on, static-page control, feature-isolation) to separate extension faults from the site's own runaway loops.
  • Metric-driven failure signatures: Interpret CDP metrics (Nodes, JSHeapUsedSize, TaskDuration, layout counters) to distinguish real leaks from harmless churn and detached-DOM CPU storms.
  • Starved-renderer profiling: Capture CPU profiles through the browser-process Tracing domain when the renderer main thread is too busy to answer normal CDP probes, then map minified frames back to site or extension code.
  • Use Case: A user reports the extension freezes a news site. You run the Puppeteer harness, discover CDP Nodes exploding while attached DOM stays flat, trace 90% of CPU to the site's own jQuery overflow loop, and ship an exclusion rule instead of rewriting extension code.

Quick Start

Use the extension-perf-forensics skill to diagnose why the extension makes this reported page freeze and produce an attributed root-cause report with pass/fail metrics.

Frequently Asked Questions about extension-perf-forensics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose a memory leak caused by a browser extension?

Run controlled experiments comparing a no-extension baseline against an extension-on run on the same page. Force garbage collection before sampling, then check whether JS heap grows after GC while DOM counts stay flat, which indicates real JS-side retention requiring heap snapshots and memlab retainer analysis.

How to load an unpacked extension in Chrome 137 with Puppeteer?

Chrome 137 and later ignore the --load-extension flag. Launch Puppeteer with pipe: true and enableExtensions: true, then call browser.installExtension(path) with Puppeteer 22.11 or later. The install does not persist across sessions, so re-install on every run.

Why does page.evaluate hang when profiling a frozen page?

In-page probes hang because the renderer main thread is starved by a busy loop, so renderer-targeted CDP commands queue indefinitely. Capture the CPU profile through the browser-process Tracing domain instead, which keeps working while the renderer spins.

How do I tell a real memory leak from normal allocation churn?

A real leak survives forced garbage collection, while churn is allocated then collected, showing as oscillating node counts with stable heap. Force GC via HeapProfiler.collectGarbage before measuring; only growth after GC counts as retention.

Can a website itself cause the freeze instead of the extension?

Yes. Sites ship their own unbounded loops, such as while-overflow handlers inside ResizeObservers, that any size-changing extension can trigger. Confirm by neutralizing the suspect DOM region with an exclusion rule; clean numbers mean the fix belongs in a site rule, not extension code.