-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage2.html
More file actions
27 lines (26 loc) · 899 Bytes
/
page2.html
File metadata and controls
27 lines (26 loc) · 899 Bytes
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
<!doctype html>
<html lang="en">
<head>
<meta charset='utf-8'>
<title>Test offline application</title>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<div><a href="./index.html">Вернуться на страницу №1</a></div>
<div>
<p>А это другая страница, которая тоже работает в offline</p>
</div>
<script>
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('./offline-worker.js', { scope: '/' })
.then(function(registration) {
console.log('Service Worker for Offline is registered');
});
navigator.serviceWorker.ready.then(function(registration) {
console.log('Service Worker Ready');
});
}
</script>
</body>
</html>