This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.
Summary
Specifies an event listener to receive click events. These events occur when the user clicks on a displayed Notification.
Syntax
instanceOfNotification.onclick = funcRef;
Where funcRef is a function to be called when the click event occurs.
Specifications
| Specification | Status | Comment |
|---|---|---|
| Web Notifications | Working Draft | Initial specification. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 5 webkit (see notes) 22 |
4.0 moz (see notes) 22 |
Not supported | ? | 6 (see notes) |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | 4.0 moz (see notes) 22 |
Not supported | ? | ? |
Gecko notes
- Prior to Firefox 22, the instantiation of a new notification must be done with the
navigator.mozNotificationobject through itscreateNotificationmethod. - Prior to Firefox 22, the Notification was displayed when calling the
showmethod and was supporting theclickandcloseevents only.
Chrome notes
- Prior to Chrome 22, the support for notification was following an old prefixed version of the specification and was using the
navigator.webkitNotificationsobject to instantiate a new notification. - Chrome does not implement the
Notification.permissionproperty yet.
Safari notes
- Safari started supporting notification with Safari 6 but only on Mac OSX 10.8+ (Moutain Lion).


Mozilla Developer Network