Last active
June 9, 2020 19:25
-
-
Save martinschierle/799655f30996d130db0160e000a1db24 to your computer and use it in GitHub Desktop.
JS Snippet to add to devtools to get CLS and LCP data
This file contains 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
let po = new PerformanceObserver((list) => { | |
for (const entry of list.getEntries()) { | |
console.log(entry); | |
} | |
}); | |
po.observe({type: 'layout-shift', buffered: true}); | |
let po2 = new PerformanceObserver((list) => { | |
for (const entry of list.getEntries()) { | |
console.log(entry); | |
} | |
}); | |
po2.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