window.cancelIdleCallback()

Experimental: 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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
cancelIdleCallback
47
79
55
No
Yes
No
47
47
55
Yes
No
5.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelIdleCallback