added notifications
This commit is contained in:
parent
37f74cacfa
commit
c9da5b8078
4 changed files with 23 additions and 3 deletions
|
@ -20,7 +20,21 @@ function strToIv(str) {
|
|||
return iv;
|
||||
}
|
||||
|
||||
function notify(str) {
|
||||
if (!("Notification" in window)) {
|
||||
return;
|
||||
} else if (Notification.permission === 'granted') {
|
||||
new Notification(str)
|
||||
} else if (Notification.permission !== 'denied') {
|
||||
Notification.requestPermission(function(permission) {
|
||||
if (permission === 'granted')
|
||||
new Notification(str);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ivToStr,
|
||||
strToIv
|
||||
strToIv,
|
||||
notify
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue