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
d8af41d6
Commit
d8af41d6
authored
Feb 16, 2017
by
Arunoda Susiripala
Committed by
Guillermo Rauch
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a way to disable running service workers. (#1167)
parent
2c9c84e1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
router.js
lib/router/router.js
+10
-0
No files found.
lib/router/router.js
View file @
d8af41d6
...
@@ -10,6 +10,16 @@ import { loadGetInitialProps, getLocationOrigin } from '../utils'
...
@@ -10,6 +10,16 @@ import { loadGetInitialProps, getLocationOrigin } from '../utils'
// Add "fetch" polyfill for older browsers
// Add "fetch" polyfill for older browsers
if
(
typeof
window
!==
'undefined'
)
{
if
(
typeof
window
!==
'undefined'
)
{
require
(
'whatwg-fetch'
)
require
(
'whatwg-fetch'
)
// Unregister if there's an exisiting service worker.
// This is because we ship a service worker in previous version.
// We don't use it and having a already running worker might cause issues.
// (We can remove this in future releases)
navigator
.
serviceWorker
.
getRegistrations
()
.
then
((
registrations
)
=>
{
for
(
let
registration
of
registrations
)
{
registration
.
unregister
()
}
})
}
}
export
default
class
Router
extends
EventEmitter
{
export
default
class
Router
extends
EventEmitter
{
...
...
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