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 APIThe 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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 42 |
Edge
Full support ≤18 |
Firefox Full support 44 Full support 44 Notes' Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API. |
IE
No support No |
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.
NotificationEvent.NotificationEvent() by Mozilla Contributors is licensed under CC-BY-SA 2.5.