Skip to content

Instantly share code, notes, and snippets.

@martinschierle
Last active June 9, 2020 19:25
Show Gist options
  • Save martinschierle/799655f30996d130db0160e000a1db24 to your computer and use it in GitHub Desktop.
Save martinschierle/799655f30996d130db0160e000a1db24 to your computer and use it in GitHub Desktop.
JS Snippet to add to devtools to get CLS and LCP data
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