mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Remove Service Worker unregister code. (#1568)
We don't need to do it now. Because, any running service workers might have stopped by now.
This commit is contained in:
parent
d32e69eeb9
commit
4a069e9d93
|
@ -9,25 +9,6 @@ import { _notifyBuildIdMismatch } from './'
|
||||||
|
|
||||||
const webpackModule = module
|
const webpackModule = module
|
||||||
|
|
||||||
if (typeof window !== 'undefined' && typeof navigator.serviceWorker !== 'undefined') {
|
|
||||||
navigator.serviceWorker.getRegistrations()
|
|
||||||
.then(registrations => {
|
|
||||||
registrations.forEach(registration => {
|
|
||||||
if (!registration.active) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (registration.active.scriptURL.indexOf('_next-prefetcher.js') === -1) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
console.warn(`Unregistered deprecated 'next/prefetch' ServiceWorker. See https://github.com/zeit/next.js#prefetching-pages`)
|
|
||||||
registration.unregister()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class Router {
|
export default class Router {
|
||||||
constructor (pathname, query, as, { Component, ErrorComponent, err } = {}) {
|
constructor (pathname, query, as, { Component, ErrorComponent, err } = {}) {
|
||||||
// represents the current component key
|
// represents the current component key
|
||||||
|
|
Loading…
Reference in a new issue