const po = new PerformanceObserver((list) => {
for (const e of list.getEntries()) {
if (e.name === 'first-contentful-paint') {
console.log('FCP:', e.startTime); // мс от navigationStart
}
}
});
po.observe({ type: 'paint', buffered: true });
<link rel="preload" as="font" href="/fonts/Inter-var.woff2" type="font/woff2" crossorigin>
<link rel="preconnect" href="https://cdn.example.com" crossorigin>