aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/notification/actions/index.html
blob: 0646fd416d1f361cada6bb105b613302803bc68c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
title: Notification.actions
slug: Web/API/notification/actions
tags:
  - Notification actions
  - Notifications
  - Web API
  - Web Notifications API
translation_of: Web/API/Notification/actions
---
<p>{{APIRef("Web Notifications")}}</p>

<p><span class="seoSummary">{{domxref("Notification")}}接口的只读属性<strong><code>actions</code></strong>返回使用{{domxref("Notification.Notification","Notification()")}}构造函数创建通知时使用actions选项设置的{{domxref("NotificationAction")}}对象列表。这是用户可以在通知上下文中选择立即执行的应用定义的操作列表。</span></p>

<p>{{AvailableInWorkers}}</p>

<h2 id="Syntax" name="Syntax">语法</h2>

<pre class="syntaxbox">var <em>actions</em>[] = <em>Notification</em>.actions;</pre>

<h3 id="Return_Value" name="Return_Value"></h3>

<p>{{domxref("NotificationAction")}}对象的只读数组。用户在通知中选择每项的单一的功能。</p>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">规范</th>
   <th scope="col">状态</th>
   <th scope="col">说明</th>
  </tr>
  <tr>
   <td>{{SpecName('Web Notifications','#dom-notification-actions','actions')}}</td>
   <td>{{Spec2('Web Notifications')}}</td>
   <td>Living standard</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatChrome(53)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatOpera(40)}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>Available in workers</td>
   <td>{{CompatChrome(53)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatOpera(40)}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android Webview</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>
    <p>{{CompatNo}}</p>
   </td>
   <td>{{CompatChrome(53)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatOperaMobile(40)}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>Available in workers</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatChrome(53)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatOperaMobile(40)}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<h3 id="Firefox_OS_相关">Firefox OS 相关</h3>

<p>{{Page("/en-US/docs/Web/API/Notifications_API", "Firefox OS notes")}}</p>

<h3 id="Chrome_相关">Chrome 相关</h3>

<p>{{Page("/en-US/docs/Web/API/Notifications_API", "Chrome notes")}}</p>

<h3 id="Safari_相关">Safari 相关</h3>

<p>{{Page("/en-US/docs/Web/API/Notifications_API", "Safari notes")}}</p>

<h2 id="更多">更多</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API">Using the Notifications API</a></li>
</ul>