blob: 3f0ac8e6318e30ecf8aa6d839300ab0df3ec4ec5 (
plain)
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
|
const btn = document.getElementById("notbtn")
btn.addEventListener("click", () => requestPermission())
function requestPermission() {
console.log("Requesting permission...");
Notification.requestPermission().then((permission) => {
if (permission === "granted") {
console.log("Notification permission granted.");
}
});
}
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)
});
|