forked from januwA/web-app-pwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (79 loc) · 2.98 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<html>
<head>
<meta charset="utf-8" />
<title>ajanuw</title>
<link rel="shortcut icon" type="image/ico" href="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="renderer" content="webkit" />
<meta name="keywords" content="ajanuw" />
<meta name="description" content="PWA, Web PWA, Web App" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Window-target" content="_top" />
<meta http-equiv="content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<meta http-equiv="imagetoolbar" content="false" />
<link rel="icon" sizes="192x192" href="./t_192.png" />
<link rel="apple-touch-icon" href="./t_96.png" />
<meta name="msapplication-square310x310logo" content="./t_96.png" />
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent"
/>
<link rel="apple-touch-startup-image" href="./t_192.png" />
<link rel="manifest" href="manifest.json" />
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("./sw.js")
.then(function (registration) {
// Registration was successful
console.log(
"ServiceWorker registration successful with scope: ",
registration.scope
);
})
.catch(function (err) {
// registration failed :(
console.log("ServiceWorker registration failed: ", err);
});
}
window.addEventListener("beforeinstallprompt", function (e) {
e.userChoice.then(function (choiceResult) {
console.log(choiceResult.outcome);
if (choiceResult.outcome == "dismissed") {
console.log("User cancelled home screen install");
} else {
// 如果用户将网页添加到主屏幕
console.log("User added to home screen");
}
});
});
</script>
</head>
<body>
<!--[if lt IE 8]>
<h3>请升级你的浏览器,或更换主浏览器!!!</h3>
<![endif]-->
hello
<img src="./t_48.png" alt="48x img" />
<img src="./t_96.png" alt="96x img" />
<img src="./t_192.png" alt="192x img" />
<script>
function fullscreen(el) {
this.webkitRequestFullscreen();
}
Array.from(document.getElementsByTagName("img")).forEach((el) =>
el.addEventListener("click", fullscreen)
);
</script>
</body>
</html>
</html>