Window: cancelIdleCallback() method

The window.cancelIdleCallback() method cancels a callback previously scheduled with window.requestIdleCallback().

Syntax

js
cancelIdleCallback(handle)

Parameters

handle

The ID value returned by window.requestIdleCallback() when the callback was established.

Return value

None (undefined).

Examples

Specifications

Specification
requestIdleCallback() Cooperative Scheduling of Background Tasks
# the-cancelidlecallback-method

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
cancelIdleCallback