| OLD | NEW |
| 1 // Sends a message to all clients when the notificationclick event gets received
. | 1 // Sends a message when the notificationclick event gets received. |
| 2 var messagePort = null; | 2 var messagePort = null; |
| 3 | 3 |
| 4 addEventListener('message', function(event) { | 4 addEventListener('message', function(event) { |
| 5 messagePort = event.data; | 5 messagePort = event.data; |
| 6 messagePort.postMessage('ready'); | 6 messagePort.postMessage('ready'); |
| 7 }); | 7 }); |
| 8 | 8 |
| 9 addEventListener('notificationclick', function(event) { | 9 addEventListener('notificationclick', function(event) { |
| 10 // FIXME: Include the notification's title in the confirmation reply. | 10 messagePort.postMessage('Clicked on Notification: ' + event.notification.tit
le); |
| 11 messagePort.postMessage('The notification has been clicked on.'); | |
| 12 }); | 11 }); |
| OLD | NEW |