This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 7
7
< meta name ="theme-color " content ="#000000 " />
8
8
< meta name ="description " content ="Todo App " />
9
9
< link rel ="apple-touch-icon " href ="%PUBLIC_URL%/logo192.png " />
10
+ <!-- <link rel="apple-touch-icon" href="./logo192.png" /> -->
10
11
<!--
11
12
manifest.json provides metadata used when your web app is installed on a
12
13
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
13
14
-->
14
15
< link rel ="manifest " href ="%PUBLIC_URL%/manifest.json " />
16
+ <!-- <link rel="manifest" href="./manifest.json" /> -->
15
17
<!--
16
18
Notice the use of %PUBLIC_URL% in the tags above.
17
19
It will be replaced with the URL of the `public` folder during the build.
41
43
window.addEventListener('load', () => {
42
44
console.log('serviceWorker custom');
43
45
navigator.serviceWorker
44
- .register('./my-serviceworker.js')
46
+ .register('./my-serviceworker.js', {
47
+ // scope: '.', // <--- THIS BIT IS REQUIRED
48
+ })
45
49
.then((reg) => console.log('Success: ', reg.scope))
46
50
.catch((err) => console.log('Failure: ', err));
47
51
});
Original file line number Diff line number Diff line change 1
1
const CACHE_NAME = 'version-1' ;
2
2
const urlsToCache = [
3
+ '/' ,
3
4
'index.html' ,
4
5
'offline.html' ,
5
6
'https://todo-restapi-app.herokuapp.com/api/todos' ,
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ export function register(config) {
34
34
window . addEventListener ( 'load' , ( ) => {
35
35
const swUrl = `${ process . env . PUBLIC_URL } /service-worker.js` ;
36
36
37
+ console . log ( 'swUrl' , swUrl ) ;
37
38
if ( isLocalhost ) {
39
+ console . log ( 'if part' ) ;
38
40
// This is running on localhost. Let's check if a service worker still exists or not.
39
41
checkValidServiceWorker ( swUrl , config ) ;
40
42
@@ -48,6 +50,7 @@ export function register(config) {
48
50
} ) ;
49
51
} else {
50
52
// Is not localhost. Just register service worker
53
+ console . log ( 'else part' ) ;
51
54
registerValidSW ( swUrl , config ) ;
52
55
}
53
56
} ) ;
@@ -58,6 +61,7 @@ function registerValidSW(swUrl, config) {
58
61
navigator . serviceWorker
59
62
. register ( swUrl )
60
63
. then ( ( registration ) => {
64
+ console . log ( 'react sw working ........ . . . . . .' ) ;
61
65
registration . onupdatefound = ( ) => {
62
66
console . log ( 'serviceWorker working' ) ;
63
67
const installingWorker = registration . installing ;
You can’t perform that action at this time.
0 commit comments