You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// * `preload` indicates higher priority than `prefetch`. Preloaded content are expected to be used soon. For example, chrome will warn if the preloaded content is not used within 3 or 5 seconds. While project here will not be runned until the user clicks some "run" button.
14
+
// * `preload` results are not shared across different documents, while the iframe content is a different document. The "preloading" is meaningful only when the HTTP cache is shared, which is more like the case of `prefetch`.
15
+
const link =document.createElement('link')
16
+
link.rel='prefetch'
17
+
link.href=url
18
+
link.crossOrigin='anonymous'
19
+
link.onload=link.onerror= () => {
20
+
document.head.removeChild(link)
21
+
}
22
+
document.head.appendChild(link)
23
+
}
24
+
25
+
// preload resources (for example, wasm files) to accelerate the loading
0 commit comments