Last active
February 4, 2020 14:59
-
-
Save leon0707/c6b450932c970888e217b581bfe091f2 to your computer and use it in GitHub Desktop.
Revisions
-
leon0707 revised this gist
Feb 4, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // client.js if ('serviceWorker' in navigator) { // register a service worker for this site navigator.serviceWorker.register('cache-worker.js'); navigator.serviceWorker.ready .then((reg) => { // registration worked -
leon0707 created this gist
Feb 4, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // client.js if ('serviceWorker' in navigator) { // register a service worker for this site navigator.serviceWorker.register('service-worker.js'); navigator.serviceWorker.ready .then((reg) => { // registration worked console.log('Registration succeeded. Scope is ' + reg.scope); }).catch((error) => { // registration failed console.log('Registration failed with ' + error); }); }