File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -50,15 +50,15 @@ export async function prefetch(url) {
50
50
await waitForServiceWorker ( )
51
51
const link = document . createElement ( 'link' )
52
52
const { relList } = link
53
- link . setAttribute ( 'href' , addPrefetchParam ( url ) )
54
53
55
- link . setAttribute (
56
- 'rel' ,
54
+ const rel =
57
55
relList . supports ( 'preload' ) && /* istanbul ignore next */ ! relList . supports ( 'prefetch' )
58
56
? /* istanbul ignore next */ 'preload'
59
- : 'prefetch' , // Safari does not support prefetch so we use preload instead
60
- )
57
+ : 'prefetch' // Safari does not support prefetch so we use preload instead
61
58
59
+ link . setAttribute ( 'href' , addPrefetchParam ( url ) )
60
+ link . setAttribute ( 'as' , 'fetch' )
61
+ link . setAttribute ( 'rel' , rel )
62
62
document . head . append ( link )
63
63
}
64
64
You can’t perform that action at this time.
0 commit comments