summaryrefslogtreecommitdiff
path: root/client.html
diff options
context:
space:
mode:
Diffstat (limited to 'client.html')
-rw-r--r--client.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/client.html b/client.html
new file mode 100644
index 0000000..9150a7a
--- /dev/null
+++ b/client.html
@@ -0,0 +1,32 @@
+<meta charset="UTF-8">
+<body onload="getNotPerm()">
+<script>
+function handlePermissions(result) {
+ console.log("Permission "+ result);
+ permissionDisplay = document.getElementsByClassName("pd")[0];
+ grantedMsg = "You have granted notification permissions";
+ deniedMsg = "You have not granted notification permissions";
+ if(result == "granted"){
+ permissionDisplay.innerHTML = grantedMsg;
+ } else {
+ permissionDisplay.innerHTML = deniedMsg;
+ }
+ poop = result;
+ return;
+}
+function getNotPerm() {
+ Notification.requestPermission().then(handlePermissions);
+ Notification.requestPermission();
+ navigator.serviceWorker.register('/sw.js');
+ return;
+}
+function notify() {
+ msg = new Notification("あなたはチンチンが大好き");
+ msg.show();
+}
+</script>
+<!--- Permission display-->
+<p class="pd">You have not granted notification permissions</p>
+<button onclick="getNotPerm()">Re-request Notification Permissions</button>
+<button onclick="notify()">Send Notifications</button>
+</body>