swup / preload-plugin

A swup plugin for preloading pages to speed up navigation 🚀

Home Page:https://swup.js.org/plugins/preload-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

requestIdleCallback not available in Safari

jorisnoo opened this issue · comments

Although the plugin seems to work just fine, the following error is being thrown in Safari: Unhandled Promise Rejection: ReferenceError: Can't find variable: requestIdleCallback, as the browser does not support requestIdleCallback.

See a related issue: remix-run/indie-stack#124 where a possible fallback is being suggested.

Thanks for all your effort on this, much appreciated!

Wow, I just checked the caniuse page for requestIdleCallback and Safari has had support for this for more than three years now but it's still behind a feature flag 😩 Falling back to setTimeout should work here as well. Thanks for reporting!

Fixed and released as 3.2.3, thanks again for reporting.