aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/navigator/mozsms/index.html
blob: c6c9aff864395a8957af7d7b48dccdf67de94154 (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
---
title: Navigator.mozSms
slug: Web/API/Navigator/mozSms
translation_of: Archive/B2G_OS/API/Navigator/mozSms
---
<p>{{APIRef("Firefox OS")}}</p>

<p>{{ non-standard_header() }}</p>

<p>{{ obsolete_header(25) }}</p>

<p>{{ B2GOnlyHeader2('certified') }}</p>

<p>返回 {{ domxref("SmsManager") }} 对象,你可以通过该对象进行短消息的收发操作。</p>

<div class="note">
<p>注意: <strong>废弃! </strong>该对象已被废弃,请参考使用: {{ domxref("window.navigator.mozMobileMessage") }}</p>
</div>

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

<pre class="eval">var sms = window.navigator.mozSms;
</pre>

<h2 id="参数说明">参数说明</h2>

<p>这是一个非标准接口,不过该接口有在 W3C 部分提及: <a href="http://www.w3.org/2012/sysapps/" title="http://www.w3.org/2012/sysapps/">System Application Working Group</a>.</p>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('Messaging')}}</td>
   <td>{{Spec2('Messaging')}}</td>
   <td>Editor Draft (WIP).</td>
  </tr>
 </tbody>
</table>

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

<p>For obvious reasons, support is primarily expected on mobile browsers.</p>

<p>{{ CompatibilityTable() }}</p>

<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>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatGeckoMobile("12.0") }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="Preferences_availability">Preferences &amp; availability</h2>

<ul>
 <li>WebSMS is disabled by default and can be enabled setting the preference <code>dom.sms.enabled</code> to true.</li>
 <li>A comma-separated whitelist of allowed hostnames that are allowed to use the WebSMS API must be specified using the <code>dom.sms.whitelist</code> preference. This string is empty by default.</li>
 <li>WebSMS is only available to certified apps on Firefox OS (B2G).</li>
</ul>

<h2 id="参阅">参阅</h2>

<ul>
 <li><a href="/en-US/docs/API/WebSMS" title="/en-US/docs/API/WebSMS">WebSMS API</a></li>
 <li>{{ domxref("SmsManager") }}</li>
 <li>{{ domxref("window.navigator.mozTelephony") }} for controlling telephone calls.</li>
</ul>