Skip to content

Instantly share code, notes, and snippets.

@gmetais
Last active August 2, 2022 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmetais/a3faae3e0148df36bb1d4d4f1d28e281 to your computer and use it in GitHub Desktop.
Save gmetais/a3faae3e0148df36bb1d4d4f1d28e281 to your computer and use it in GitHub Desktop.
INP (Interaction to Next Paint) debugging in Chrome's console
// 1. Open Chrome's console
// 2. Activate the option "Preserve log"
// 3. Copy-paste this script
// 4. Interact with the page (clicks, keyhits...)
// 5. Refresh the page or switch tab twice, the console will then log the INP culprits > 40ms.
var s=document.createElement('script');s.src='//unpkg.com/web-vitals@next/dist/web-vitals.iife.js';s.onload=()=>{webVitals.onINP(console.log)};document.head.appendChild(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment