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

 

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support47 No

55

531

No Yes No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support4747 ?

55

531

? No ?

1. 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.

 

Document Tags and Contributors

Contributors to this page: lucian95, jpmedley, myakura, Sheppy, Permutator, Jinva, rolfedh
Last updated by: lucian95,