Created
March 10, 2025 14:32
-
-
Save 0m3r/47df37dd1882c4c0bd16b5c037a69aa3 to your computer and use it in GitHub Desktop.
Run in chrome to get LCP image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const observer = new PerformanceObserver((list) => { | |
const entries = list.getEntries(); | |
const lastEntry = entries[entries.length - 1]; // Use the latest LCP candidate | |
console.log("LCP:", lastEntry.startTime); | |
console.log(lastEntry); | |
}); | |
observer.observe({ type: "largest-contentful-paint", buffered: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment