requestIdleCallback()Limited availability
The requestIdleCallback() API queues a function that runs in idle browser time, either at the end of a frame or when the user is inactive. Also known as the background tasks API.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–46Not supported
47+Supportedsince Dec 1, 2015
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–54Not supported
55+Supportedsince Aug 8, 2017
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–46Not supported
47+Supportedsince Dec 2, 2015
Current: 155Firefox Android
4–54Not supported
55+Supportedsince Aug 8, 2017
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Safari, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: IdleDeadline.
Feature detection
JS · check before using
if ("Window" in globalThis && "requestIdleCallback" in Window.prototype) {
// Window.requestIdleCallback is available
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (5). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| IdleDeadline | 47 | 79 | 55 | ✕ | 47 | 55 | ✕ |
| IdleDeadline.didTimeout | 47 | 79 | 55 | ✕ | 47 | 55 | ✕ |
| IdleDeadline.timeRemaining | 47 | 79 | 55 | ✕ | 47 | 55 | ✕ |
| Window.cancelIdleCallback | 47 | 79 | 55 | ✕ | 47 | 55 | ✕ |
| Window.requestIdleCallback | 47 | 79 | 55 | ✕ | 47 | 55 | ✕ |