browser idle time
Moments when the browser has finished urgent work and is waiting, which scripts can use for low-priority tasks.
In more detail
requestIdleCallback lets code run in these gaps without delaying user input or rendering. Idle time is not guaranteed, so work scheduled this way must tolerate waiting.
Example
next/script lazyOnload waits until the page has fully loaded and the browser is idle.Related terms
- lazyOnload — A next/script strategy that loads the script only after everything else has loaded, during browser idle time.
- main thread — The first thread a program starts with; in a browser page it also runs JavaScript and handles input, layout and painting.
Taught in
- Script Optimization: next/script & Lazy Third Parties — Next.js 15 & Modern App Router Architecture