added Notification to WebUI
This commit is contained in:
@@ -44,7 +44,7 @@ function onMessage(event) {
|
||||
|
||||
if(dtcArray[0] != "0")
|
||||
{
|
||||
notifyMe();
|
||||
processDTCNotifications(dtcArray);
|
||||
fillDTCTable(dtcArray);
|
||||
}
|
||||
console.log(dtcArray + "\n");
|
||||
@@ -82,18 +82,4 @@ function do_resize(textbox) {
|
||||
else textbox.rows = rows;
|
||||
}
|
||||
|
||||
function notifyMe() {
|
||||
if (!("Notification" in window)) {
|
||||
alert("This browser does not support desktop notification");
|
||||
} else if (Notification.permission === "granted") {
|
||||
const notification = new Notification("Hi there!");
|
||||
// …
|
||||
} else if (Notification.permission !== "denied") {
|
||||
Notification.requestPermission().then((permission) => {
|
||||
if (permission === "granted") {
|
||||
const notification = new Notification("Hi there!");
|
||||
// …
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user