Last active
August 2, 2022 13:46
-
-
Save gmetais/a3faae3e0148df36bb1d4d4f1d28e281 to your computer and use it in GitHub Desktop.
INP (Interaction to Next Paint) debugging in Chrome's console
This file contains hidden or 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
// 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