Web/API/Window/cancelIdleCallback

From Get docs

This is an experimental technologyCheck 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

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

cancelIdleCallback

Experimental'

Chrome

Full support 47

Edge

Full support 79

Firefox 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 No

Opera

Full support Yes

Safari

No support No

WebView Android

Full support 47

Chrome Android

Full support 47

Firefox 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 Yes

Safari iOS

No support No

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