Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
69a34dd7
Unverified
Commit
69a34dd7
authored
Dec 24, 2019
by
Joe Haddad
Committed by
GitHub
Dec 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix IE11 Prefetching (#9823)
parent
3e05139d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
page-loader.js
packages/next/client/page-loader.js
+10
-9
No files found.
packages/next/client/page-loader.js
View file @
69a34dd7
import
mitt
from
'../next-server/lib/mitt'
function
has
Prefetch
(
link
)
{
function
has
Rel
(
rel
,
link
)
{
try
{
link
=
document
.
createElement
(
'link'
)
return
link
.
relList
.
supports
(
'prefetch'
)
return
link
.
relList
.
supports
(
rel
)
}
catch
{}
}
const
relPrefetch
=
hasPrefetch
()
?
// https://caniuse.com/#feat=link-rel-prefetch
// IE 11, Edge 12+, nearly all evergreen
'prefetch'
:
// https://caniuse.com/#feat=link-rel-preload
// macOS and iOS (Safari does not support prefetch)
'preload'
const
relPrefetch
=
hasRel
(
'preload'
)
&&
!
hasRel
(
'prefetch'
)
?
// https://caniuse.com/#feat=link-rel-preload
// macOS and iOS (Safari does not support prefetch)
'preload'
:
// https://caniuse.com/#feat=link-rel-prefetch
// IE 11, Edge 12+, nearly all evergreen
'prefetch'
const
hasNoModule
=
'noModule'
in
document
.
createElement
(
'script'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment