OLD | NEW |
---|---|
(Empty) | |
1 // Sends a message when the notificationclick event gets received, and closes th e | |
2 // notification which was shown from that event. | |
3 var messagePort = null; | |
4 | |
5 addEventListener('message', function(event) { | |
6 messagePort = event.data; | |
7 messagePort.postMessage('ready'); | |
8 }); | |
9 | |
10 addEventListener('notificationclick', function(event) { | |
11 event.notification.close(); | |
12 messagePort.postMessage('Clicked on Notification: ' + event.notification.tit le); | |
13 }); | |
OLD | NEW |