NotificationEvent.NotificationEvent()
This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage 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 specification changes.
Draft
This page is not complete.
The NotificationEvent()
constructor creates a new NotificationEvent
object.
Syntax
JavaScript
Copy Code
var myNotificationEvent = new NotificationEvent(type, NotificationEventInit);
Parameters
- type
- TBD
- NotificationEventInit Optional
- A dictionary object containing a
Notification
object to be used as the notification the event is dispatched on. In later drafts of the specification, this parameter is not optional.
Example
JavaScript
Copy Code
var n = new Notification('Hello'); var init = { notification: n }; var myNotificationEvent = new NotificationEvent(type, init);
Specifications
Specification | Status | Comment |
---|---|---|
Notifications API The definition of 'NotificationEvent()' in that specification. |
Recommendation | Living standard. |
Browser Compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 42.0 | 44.0 (44.0)[1] | ? | ? | ? |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | No support | No support | 44.0 (44.0) | (Yes) | ? | ? | ? | 42.0 |
[1] Service workers (and Push) have been disabled in the Firefox 45 Extended Support Release (ESR.)
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/notificationevent/notificationevent