window.cancelIdleCallback()

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Summary

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

Syntax

window.cancelIdleCallback(handle);

Parameters

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

Return value

undefined.

Example

See our complete example in the article Cooperative Scheduling of Background Tasks API.

Specifications

Specification Status Comment
Cooperative Scheduling of Background Tasks Proposed Recommendation Initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
cancelIdleCallback
Experimental
Chrome Full support 47Edge Full support 79Firefox Full support 55
Full support 55
Full support 53
Disabled
Disabled From version 53: this feature is behind the dom.requestIdleCallback.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support YesSafari No support NoWebView Android Full support 47Chrome Android Full support 47Firefox Android Full support 55
Full support 55
Full support 53
Disabled
Disabled From version 53: this feature is behind the dom.requestIdleCallback.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support 5.0

Legend

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
User must explicitly enable this feature.
User must explicitly enable this feature.