Notification: data property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The data read-only property of the Notification interface returns a structured clone of the notification's data, as specified in the data option of the Notification() constructor.

The notification's data can be any arbitrary data that you want associated with the notification.

Value

A structured clone.

Examples

The following snippet fires a notification; a simple options object is created, then the notification is fired using the Notification() constructor.

js
const options = {
  body: "Your code submission has received 3 new review comments.",
  data: {
    url: "https://example.com/review/12345",
    status: "open",
  },
};

const n = new Notification("New review activity", options);

console.log(n.data); // Logs the data object

Specifications

Specification
Notifications API
# dom-notification-data

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
data
Chrome – Full support
Chrome 44 (Release date: 2015-07-21)
footnote Full support
Edge – Full support
Edge 16 (Release date: 2017-10-17)
footnote Full support
Firefox – Full support
Firefox 34 (Release date: 2014-12-01)
footnote Full support
Opera – Full support
Opera 31 (Release date: 2015-08-04)
footnote Full support
Safari – Full support
Safari 16 (Release date: 2022-09-12)
footnote Full support
Chrome Android – Full support
Chrome Android 44 (Release date: 2015-07-29)
footnote Full support
Firefox for Android – Full support
Firefox for Android 34 (Release date: 2014-12-01)
footnote Full support
Opera Android – Full support
Opera Android 32 (Release date: 2015-09-23)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – No support
WebView Android
footnote
footnote See bug 40443309
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

See also