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) {
5050 await waitForServiceWorker ( )
5151 const link = document . createElement ( 'link' )
5252 const { relList } = link
53- link . setAttribute ( 'href' , addPrefetchParam ( url ) )
5453
55- link . setAttribute (
56- 'rel' ,
54+ const rel =
5755 relList . supports ( 'preload' ) && /* istanbul ignore next */ ! relList . supports ( 'prefetch' )
5856 ? /* 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
6158
59+ link . setAttribute ( 'href' , addPrefetchParam ( url ) )
60+ link . setAttribute ( 'as' , 'fetch' )
61+ link . setAttribute ( 'rel' , rel )
6262 document . head . append ( link )
6363}
6464
You can’t perform that action at this time.
0 commit comments