Notificationクラスを上書きしてキューにためておく。通知を制御するExtensionなんかが作れないかなーと思ってメモ
let queue = []
class MyNotification {
constructor(title, options) {
queue.push({title: title, options: options})
}
static async notify(notifications) {
for (let i in notifications) {
new OrgNotification(notifications[i].title, notifications[i].options)
await new Promise(r => setTimeout(r, 1000))
}
}
}
OrgNotification = Notification
Notification = MyNotification
new Notification("title1")
new Notification("title2")
new Notification("title3")
await Notification.notify(queue)