This translation is incomplete. Please help translate this article from English

data 只读属性是 Notification 的接口,当它作为构造函数的option可选项之一时,返回结构化的Notification的data数据。


Note: 此特性在 Web Worker 中可用。



function structuralClone(obj) {
  return new Notification('', {data: obj, silent: true}).data;

Syntax 表达式

var data =;



Examples 例子

产生一个 notification; 简单的options 作为构造参数, 将会触发以option为构造参数的 Notification() .

var options = {
  body: 'Do you like my body?',
  data: 'I like peas.'

var n = new Notification('Test notification',options); // should return 'I like peas.'


Specification Status Comment
Notifications API
Living Standard Living standard

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 44 (Yes) 未实现 未实现 34 未实现
Available in workers 44 ? 41.0 (41.0) ? 34 ?
Secure contexts only 62 ? ? ? 49 ?
Feature Android Webview Chrome for Android Edge Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support 未实现 44 (Yes) 未实现 未实现 未实现 34 未实现
Available in workers 未实现 44 ? 41.0 (41.0) ? ? 34 ?
Secure contexts only 未实现 62 ? ? ? ? 49 ?

See also