Desktop Notification

The desktop notification feature, if enabled, allows websites to send notifications to your desktop after taking your permission. This task is performed by using the requestPermission() method, which takes one optional argument, the name of the call back function. This call back function can be any user-defined function, for instance showNotification(), which checks whether or not the user has given permission to send notifications by using the checkPermission() method. After getting the permission, the call back function, showNotification(), calls the createNotification() method to display the notification message. The createNotification() method takes three arguments: an image, a title, and a message. If you do not want to display an image to appear in your notification, you can leave the argument as blank. The following code snippet shows how to send desktop notifications:

function RequestPermission (callback) { window.webkitNotifications.requestPermission(callback); } function showNotification(){ if (window.webkitNotifications.checkPermission() > 0) { RequestPermission(showNotification); } else { window.webkitNotifications.createNotification("http://localhost:8080/images/tick.jpg", "Title", "Body").show(); } }

Click here for demos to see how to implement the desktop notification feature:
demo