From 17977f8d2230d946b2a09bfa09f3956276503919 Mon Sep 17 00:00:00 2001 From: ekremney Date: Thu, 18 Apr 2024 11:47:16 +0200 Subject: [PATCH] feat: lcp uses startTime --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 6a80b23..0759c67 100644 --- a/src/index.js +++ b/src/index.js @@ -100,7 +100,7 @@ sampleRUM.drain('cwv', (() => { registerPerformanceObserver('largest-contentful-paint', (entries) => { const entry = entries.pop(); - storeCWV({ name: 'LCP', value: entry.renderTime, entries: [entry] }); + storeCWV({ name: 'LCP', value: entry.startTime, entries: [entry] }); }); registerPerformanceObserver('navigation', (entries) => { @@ -122,7 +122,7 @@ sampleRUM.drain('cwv', (() => { // When loading `web-vitals` using a classic script, all the public // methods can be found on the `webVitals` global namespace. - ['FID', 'INP', 'TTFB', 'CLS'].forEach((metric) => { + ['FID', 'INP', 'CLS'].forEach((metric) => { const metricFn = window.webVitals[`on${metric}`]; if (typeof metricFn === 'function') { const opts = isEager(metric) ? { reportAllChanges: featureToggle() } : undefined;