Skip to content

Instantly share code, notes, and snippets.

View Cst2989's full-sized avatar
🎯
Focusing

Neciu Aurel Dan Cst2989

🎯
Focusing
View GitHub Profile
@danieltxok
danieltxok / LCP.js
Created February 17, 2021 11:21
LCP Bookmarklet
javascript:
new PerformanceObserver((entryList)=>{
for (const entry of entryList.getEntries()) {
let consoleGroup = `%cLCP candidate: ${Math.round(entry.startTime)}ms`;
let styles = '';
if (entry.startTime >= 2500) {
styles = 'color: red;';
}
console.group(consoleGroup, styles);
console.log('Element:', entry.element);