October 15, 2010

How to create Chrome Notifications

(Cross-posted on the Extensible-web)

Chrome supports Webkitnotifications and Google has done a great job with their notifications for Gmail. This example shoes how to create a recurring notification using JavaScript timer and webkitnotification object.

In order to create a notification the user must first allow notification in their browser. Click on “Allow notification” button in the ASP.NET sample and the permission will be granted.

Following code block will show you how simple is to create a notification object and show it on browser.

notify = window.webkitNotifications.createNotification('iconUrl', 'Extensible-web latest article', 'http://www.extensible-web.com');

Download the full source code.

No comments: