#how to "lazy" load a dialog in a .astro component?
13 messages · Page 1 of 1 (latest)
The dialog element is native to html and shouldn't require any event listners to load it
Having the js to listen for the event will definitely make it slower
yeah but it's a modal i want to show just after load, you know these age-blocking-modals
Oh so you are wanting it to load/immediatly open when the page is loaded?
Otherwise I am missing something 😅
Could go blackhat, and simply not load if it the user agent is lightspeed
In the code the makes the dialog appear, check:
navigator.userAgent.includes('Chrome-Lighthouse');, and return early if it's true
yeah my goal was to effectively optimise it for users too, but your suggestion may make sense under some circumstances thanks