demo · v137

Crash Stack in Unresponsive-Page Reports

When a page goes unresponsive (main thread frozen long enough that Chrome flags it), the browser now includes a JavaScript call stack in the crash report sent to the site's reporting endpoint. Below: freeze your own main thread, look at what the corresponding LoAF / crash-report payload looks like.

Heads upActual crash reports are delivered out-of-band to a server. This page uses PerformanceObserver('long-animation-frame') as the in-DOM proxy to surface the same call stack the browser would put in the report.
probing…
last LoAF: —
no captures yet

the code

// Server-side opt in:
Reporting-Endpoints: crash="https://reports.example.com/c"

// Browser will now POST {"type":"crash","body":{"reason":"unresponsive","stack":[…]}}
// to that endpoint when the page hangs.

// In-DOM proxy used here:
new PerformanceObserver((list) => {
  for (const e of list.getEntries()) {
    console.log(e.scripts);  // includes call sources / durations
  }
}).observe({ type: "long-animation-frame", buffered: true });

see also