-
-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77bf564
commit 589253e
Showing
2 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Webpack App</title> | ||
</head> | ||
<body> | ||
<h1>Hello world!</h1> | ||
<h2>Tip: Check your console</h2> | ||
</body> | ||
</html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Webpack App</title> | ||
</head> | ||
<body> | ||
<h1>Hello world!</h1> | ||
<h2>Tip: Check your console</h2> | ||
<script> | ||
if ("serviceWorker" in navigator) { | ||
window.addEventListener("load", () => { | ||
navigator.serviceWorker | ||
.register("/sw.js") | ||
.then(registration => { | ||
console.log("SW registered: ", registration); | ||
}) | ||
.catch(registrationError => { | ||
console.log("SW registration failed: ", registrationError); | ||
}); | ||
}); | ||
} | ||
</script> | ||
</body> | ||
</html> |