diff --git a/public/index.html b/public/index.html index c258e4d..b826e41 100644 --- a/public/index.html +++ b/public/index.html @@ -18,10 +18,10 @@ - - - - + + + + T大树洞 diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js index a3e6c0c..cd50aac 100644 --- a/src/registerServiceWorker.js +++ b/src/registerServiceWorker.js @@ -21,13 +21,13 @@ const isLocalhost = Boolean( export default function register() { if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL(process.env.PUBLIC_URL, window.location); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 - return; - } + // const publicUrl = new URL(process.env.PUBLIC_URL, window.location); + // if (publicUrl.origin !== window.location.origin) { + // // Our service worker won't work if PUBLIC_URL is on a different origin + // // from what our page is served on. This might happen if a CDN is used to + // // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 + // return; + // } window.addEventListener('load', () => { const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;