-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
28 lines (28 loc) · 848 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ServiceWorker</title>
<style>
body {
margin: 0;
padding: 0;
}
</style>
<script>
navigator.serviceWorker.register('/sw.js', { scope: './' }).then(function(registration) {
// Registration was successful
// console.log('ServiceWorker registration successful with scope: ', registration);
}).catch(function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
</script>
</head>
<body>
<p>测试service worker</p>
<script src="./axios.js"></script>
</body>
</html>