Skip to content

Commit 4a069e9

Browse files
arunodaleo
authored andcommitted
Remove Service Worker unregister code. (vercel#1568)
We don't need to do it now. Because, any running service workers might have stopped by now.
1 parent d32e69e commit 4a069e9

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

lib/router/router.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,6 @@ import { _notifyBuildIdMismatch } from './'
99

1010
const webpackModule = module
1111

12-
if (typeof window !== 'undefined' && typeof navigator.serviceWorker !== 'undefined') {
13-
navigator.serviceWorker.getRegistrations()
14-
.then(registrations => {
15-
registrations.forEach(registration => {
16-
if (!registration.active) {
17-
return
18-
}
19-
20-
if (registration.active.scriptURL.indexOf('_next-prefetcher.js') === -1) {
21-
return
22-
}
23-
24-
console.warn(`Unregistered deprecated 'next/prefetch' ServiceWorker. See https://github.com/zeit/next.js#prefetching-pages`)
25-
registration.unregister()
26-
})
27-
})
28-
.catch(() => {})
29-
}
30-
3112
export default class Router {
3213
constructor (pathname, query, as, { Component, ErrorComponent, err } = {}) {
3314
// represents the current component key

0 commit comments

Comments
 (0)