Skip to Content
Platform.Ontology

Idle callbacks

Runs low priority work when the browser is idle; no prompt.

Works without askingSpeed and timingSchedulingWeb browsersWhile you use it

In one line

Can wait until the browser is idle to run low priority jobs

Runs low priority work when the browser is idle; no prompt.

A site can wait until the page is quiet before running analytics or prefetching. It also reveals roughly how busy your device is, since idle windows are shorter on slow devices or busy tabs.

What it can and can't do

What the user does: Nothing. It happens when the page loads and the browser is quiet

It can

  • Run analytics or preload files when things are calm
  • Learn roughly how busy your device is, since gaps are shorter on slow ones

It cannot

  • Work in Safari, which does not support it
  • Run when the browser is busy
  • Ask permission first
  • See your files

How it differs between platforms: Chrome, Edge and Firefox support it. Safari does not.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported472015-12-01None
EdgeSupported792020-01-15None
FirefoxSupported552017-08-08None
SafariBehind a flagpreviewNot listedBehind a flag or setting
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported472015-12-02None
Samsung InternetSupported5.02016-12-15None

How a site asks for it

APIrequestIdleCallback(cb, {timeout}); IdleDeadline.timeRemaining()
Browser compat keysapi.Window.requestIdleCallback
api.IdleDeadline
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsPer page; callbacks do not run when the tab is in the background in most engines
How to take it backNothing to revoke (no permission is stored)
Inside an iframePer frame; iframes get their own deadline

Typical flow

  1. Page calls requestIdleCallback
  2. Browser runs the callback when the main thread is idle
  3. Callback reads timeRemaining() and does bounded work

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • timeRemaining() is capped at 50 ms per idle period (spec) so the page stays responsive
  • Firefox and Chrome support it; Safari ships it only as a preview or flag (not in release Safari), none in iOS Safari
  • In the background, callbacks may be delayed by long periods or run only once a minute
  • A timeout option forces the callback even if the browser stays busy
  • Chrome Android and Samsung Internet support it; desktop Safari has it behind a flag or preview only

The story

What it is

A page schedules low priority work for moments when the browser has nothing urgent to do.

For you

You never see it. It helps pages stay smooth by doing small chores, like sending reports or preloading, only when nothing else needs the browser.

For makers

Teams use it to push analytics, prefetching and cleanup out of the way of clicks and typing. It improves speed scores. It can also tell a script how busy the page is.

Where you see it

TypeExampleApps
shoppingA shop preloads the next product image only when idle, so taps stay fast.None named
analyticsAn analytics tag sends data in idle time so it does not slow the page.Google Tag Manager
productivityA web editor runs spell check and autosave in idle moments, so typing stays smooth.Google Docs
gamesA browser game loads the next level in idle time between actions.None named
adsAn ad script loads its heavy parts in idle time after the page is ready.None named
developerA framework like React splits long work into small tasks in idle slices.React
newsA news site loads comments and related stories only when idle.None named

Risks

  • Not available everywhere
  • Idle gaps hint at activity

What the platform says

  • MDN: requestIdleCallback. Lets pages run background work when the browser is idle, so important work is not slowed down.

Good uses and abuse

Legitimate uses

  • Analytics batching
  • Cache warming and prefetch
  • Non-critical rendering

Known abuse

  • Hidden fingerprinting during idle time
  • Mining that avoids detection by running only when idle

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits1Rough identifying entropy, when known

History

  • 2015-12, Chrome 47: requestIdleCallback ships
  • 2017-08, Firefox 55: requestIdleCallback ships

Sources

How well checked: Based on official documentation.

On this page