MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-dev-survey

window.cancelIdleCallback()

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

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 Working Draft Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 47 53 (53)[1] ? ? ?
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support 47 47 53.0 (53)[1] ? ? ? ?

[1] Idle callback support was added in Firefox 53, but was disabled by default. To enable it, set the preference dom.requestIdleCallback.enabled to true. Idle callbacks are enabled by default starting in Firefox 55.

Document Tags and Contributors

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