1

I can't find any documentation on this one way or another. The function window.requestIdleCallback does exist in a Chrome extension's background page. But when I run

window.requestIdleCallback(() => {
  console.log("XXX idle");
});

The callback appears to never run. Is this intended behavior, or is there something that could be causing the callback to never run here?

A bit more information: the manifest does have {"persistent": true} set. And the window.requestIdleCallback function does exist, it just doesn't appear to do anything.

  • If your background page is an event page ("persistent": false), it won't work because the page will unload. Not sure if it will work if you make it persistent. – Michael Updike Apr 2 '19 at 1:55
  • 1
    This function is frame-based just like rAF so it doesn't work in a nonrenderable context such as the background page. – wOxxOm Apr 2 '19 at 4:10
  • I am not sure if requestIdleCallback is a function in Chrome since I can't find it in the Chrome API documentation, instead I found this one whom uses this function. Have you tried to check this? – MαπμQμαπkγVπ.0 Apr 2 '19 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.