Skip to content

Instantly share code, notes, and snippets.

@danieltxok
Created February 17, 2021 11:22
Show Gist options
  • Save danieltxok/e3c51768a5c3ea3f2a11c14b9b1c51cf to your computer and use it in GitHub Desktop.
Save danieltxok/e3c51768a5c3ea3f2a11c14b9b1c51cf to your computer and use it in GitHub Desktop.
FID Bookmarklet
javascript:
new PerformanceObserver((entryList)=>{
for (const entry of entryList.getEntries()) {
const delay = entry.processingStart - entry.startTime;
let consoleGroup = `%cFID value: ${Math.round(delay)}ms`;
let styles = '';
if (delay >= 100) {
styles = 'color: red;';
}
console.group(consoleGroup, styles);
console.log(`Event name: ${entry.name}`);
console.log('Element:', entry.target);
console.groupEnd(consoleGroup);
}
}
).observe({
type: 'first-input',
buffered: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment