NotificationEvent.NotificationEvent()

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

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
NotificationEvent() constructor
Experimental
Chrome Full support 42Edge Full support ≤18Firefox Full support 44
Notes
Full support 44
Notes
Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
IE ? Opera Full support 37Safari ? WebView Android No support NoChrome Android Full support 42Firefox Android Full support 44Opera Android Full support 37Safari 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.