File tree Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,4 @@ ReactDOM.render(<App />, document.getElementById('root'));
9
9
// If you want your app to work offline and load faster, you can change
10
10
// unregister() to register() below. Note this comes with some pitfalls.
11
11
// Learn more about service workers: https://bit.ly/CRA-PWA
12
- serviceWorker . unregister ( ) ;
12
+ serviceWorker . register ( ) ;
Original file line number Diff line number Diff line change 1
- // This optional code is used to register a service worker.
2
- // register() is not called by default.
3
-
4
- // This lets the app load faster on subsequent visits in production, and gives
5
- // it offline capabilities. However, it also means that developers (and users)
6
- // will only see deployed updates on subsequent visits to a page, after all the
7
- // existing tabs open on the page have been closed, since previously cached
8
- // resources are updated in the background.
9
-
10
- // To learn more about the benefits of this model and instructions on how to
11
- // opt-in, read https://bit.ly/CRA-PWA
12
-
13
1
const isLocalhost = Boolean (
14
2
window . location . hostname === 'localhost' ||
15
3
// [::1] is the IPv6 localhost address.
@@ -25,9 +13,7 @@ export function register(config) {
25
13
// The URL constructor is available in all browsers that support SW.
26
14
const publicUrl = new URL ( process . env . PUBLIC_URL , window . location . href ) ;
27
15
if ( publicUrl . origin !== window . location . origin ) {
28
- // Our service worker won't work if PUBLIC_URL is on a different origin
29
- // from what our page is served on. This might happen if a CDN is used to
30
- // serve assets; see https://github.com/facebook/create-react-app/issues/2374
16
+
31
17
return ;
32
18
}
33
19
You can’t perform that action at this time.
0 commit comments