blob: 46341d6910b73dc990cb8d1bedc9dd9bd4bcaac6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
const btn = document.getElementById("notbtn")
btn.addEventListener("click", () => requestPermission())
function requestPermission() {
console.log("Requesting permission...");
OneSignal.Notifications.requestPermission();
}
document.cookie = "session_key=0"
const data = {
duration: 2,
block: 1,
machine: 2,
}
fetch("http://localhost:8000/start", {
credentials: "include",
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
});
|