W3cubDocs

/DOM

NotificationEvent.constructor

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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()' in that specification.
Living Standard Living standard.

Browser CompatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 42 Yes 44
44
Service workers (and Push) have been disabled in the Firefox 45 and 52 Extended Support Releases (ESR).
? 37 ?
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support No 42 ? 44 37 ? 4.0

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/NotificationEvent