Send Desktop Notifications in Chrome

This is an article on Send Desktop Notifications in Chrome in JavaScript and AJAX.

Desktop notifications for web applications is a great plus, the user can be notified irrespective of the current window/tab they are using. Chrome, which has the largest share of the browser market, supports desktop notification, also Safari, or any webkit based browser.

You can easily implement it you web applications, like mail clients (GMail has this feature), CRMs, Stock Market apps, and anything you can think may use this feature. All you need to some JavaScript and a server side script to send updates, or you can do without the server part also.

Now, let's get our hands dirty with some desktop notification code.

Implementing Desktop notifications on Webkit based browsers

Try this on Chrome/Safari, first time a popup will appear asking for permission.

Additionally, you may also control what happens when the notification is clicked. Google recently launched a Rich Desktop notification where one can control the style elements of the notification body, that we'll cover in some other article in the future.