v148 · Performance · Resource Timing

MIME Type Audit

Use PerformanceResourceTiming.contentType to audit every resource loaded by this page — group by type, flag unexpected MIME types, and spot misconfigured servers that serve JavaScript as text/plain or images as application/octet-stream.

Checking for contentType support…
Resource URL Initiator Content-Type Status Transfer (B)

Reading contentType

const observer = new PerformanceObserver(list => {
  for (const entry of list.getEntries()) {
    const { name, initiatorType, contentType, transferSize } = entry;
    // contentType is the normalised MIME type e.g. "text/javascript"
    // Available in Chrome 148+
    console.log(`${initiatorType}: ${name} → ${contentType}`);
  }
});
observer.observe({ type: 'resource', buffered: true });

references

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗