Draft
This page is not complete.
The NotificationEvent()
constructor creates a new NotificationEvent
object.
Syntax
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
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() constructor' in that specification. |
Living Standard | Living standard. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
NotificationEvent() constructor | Chrome Full support 42 | Edge Full support ≤18 | Firefox
Full support
44
| IE ? | Opera Full support 37 | Safari ? | WebView Android No support No | Chrome Android Full support 42 | Firefox Android Full support 44 | Opera Android Full support 37 | Safari iOS ? | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- See implementation notes.
- See implementation notes.