useScript 'idle' requestIdleCallback Safari
wadeV12 opened this issue · comments
Roman Maliarchuk commented
Environment
Reproduction
const { $script } = useScript({
src: 'https://path.to/script.js',
async: true
}, { trigger: 'idle' })
Describe the bug
Unfortunately requestIdleCallback
https://caniuse.com/requestidlecallback is not supported by Safari so far and we need to use setTimeout
as a fallback.
https://github.com/unjs/unhead/blob/main/packages/unhead/src/composables/useScript.ts#L123
Additional context
No response
Logs
No response