if ("showTrigger"inoption)Notification.notifications.push(setTimeout(()=>newNotification(option.title,option),option.showTrigger.timestamp-newDate().getTime()));
if ("timestamp"inoption)Notification.notifications.push(setTimeout(()=>newNotification(option.title,option),option.timestamp-newDate().getTime()));
elsenewNotification(option.title,option);
}
Notification.getNotifications=(options={})=>{
...
...
@@ -45,7 +41,7 @@ async function sendNotificationAfter(seconds=5, body='Hello World', timestamp=nu
{
tag:timestamp,// a unique ID
body:body,// content of the push notification
showTrigger:newTimestampTrigger(timestamp),// set the time for the push notification
timestamp:Math.floor(timestamp),// set the time for the push notification
data:{
url:window.location.href,// pass the current url to the notification