aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/notification/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/notification/index.html')
-rw-r--r--files/zh-cn/web/api/notification/index.html76
1 files changed, 1 insertions, 75 deletions
diff --git a/files/zh-cn/web/api/notification/index.html b/files/zh-cn/web/api/notification/index.html
index 1c85a11bca..c80d973d9d 100644
--- a/files/zh-cn/web/api/notification/index.html
+++ b/files/zh-cn/web/api/notification/index.html
@@ -174,81 +174,7 @@ translation_of: Web/API/Notification
<h2 id="浏览器兼容性">浏览器兼容性</h2>
-<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>5 {{ property_prefix("webkit") }} (see notes)<br>
- 22</td>
- <td>4.0 {{ property_prefix("moz") }} (see notes)<br>
- 22</td>
- <td>{{ CompatNo() }}</td>
- <td>25</td>
- <td>6 (see notes)</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>Firefox OS</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatUnknown() }}</td>
- <td>4.0 {{ property_prefix("moz") }} (see notes)<br>
- 22</td>
- <td>1.0.1 {{ property_prefix("moz") }} (see notes)<br>
- 1.2</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatNo() }}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h3 id="Gecko_备忘">Gecko 备忘</h3>
-
-<ul>
- <li>在 Firefox 22 (Firefox OS &lt;1.2) 之前,创建一个新的通知必须使用 {{ domxref("window.navigator.mozNotification","navigator.mozNotification") }} 对象的 <code>createNotification</code> 方法。</li>
- <li>在 Firefox 22 (Firefox OS &lt;1.2) 之前,当调用 <code>show</code> 方法时通知才会被显示出来,并且只支持 <code>click</code> 和 <code>close</code> 事件。</li>
- <li>Nick Desaulniers 编写了一个 <a href="https://github.com/nickdesaulniers/fxos-irc/blob/master/js/notification.js">Notification shim</a> 以向前和向后兼容各种版本的实现。</li>
- <li>在 Firefox OS 有个特别的问题, <a href="https://github.com/nickdesaulniers/fxos-irc/blob/0160cf6c3a2b5c9fe33822aaf6bcba3b7e846da9/my.js#L171">你可以传递一个图标路径</a> 用于通知,但是如果应用被打包了你就不能使用相对路径,比如: <code>/my_icon.png</code>。同样的,你也不能这样用: <code>window.location.origin + "/my_icon.png"</code>,<code>因为 window.location.origin</code> 的值在打包的应用里为 null。 <a href="https://developer.mozilla.org/en-US/Apps/Developing/Manifest#origin">清单来源字段</a> 可以修复这个问题,但是这个方法只在 Firefox OS 1.1+ 版本中有效。不过有个潜在的解决方案可以用于 Firefox OS &lt;1.1 版本,就是 <a href="https://github.com/nickdesaulniers/fxos-irc/blob/0160cf6c3a2b5c9fe33822aaf6bcba3b7e846da9/my.js#L168">传递图标的位于外部服务器的绝对 URL</a> 。这个方案并不理想,如通知要立即显示而没有图标,那么将会请求服务器,但是可以用于所有版本的 Firefox OS。</li>
-</ul>
-
-<h3 id="Chrome_备忘">Chrome 备忘</h3>
-
-<ul>
- <li>在 Chrome 22 版本之前,如果要使用通知需要 <a href="http://www.chromium.org/developers/design-documents/desktop-notifications/api-specification">旧的带前缀版本的规范</a> ,并且使用{{domxref("window.navigator.webkitNotifications","navigator.webkitNotifications")}} 对象创建一个新的通知实例。</li>
- <li>在 Chrome 32 版本之前,不支持 {{domxref("Notification.permission")}} 属性。</li>
-</ul>
-
-<h3 id="Safari_备忘">Safari 备忘</h3>
-
-<ul>
- <li>Safari 在 Safari 6 版本开始支持通知,但是只能在 Mac OSX 10.8+ (Mountain Lion) 中使用。</li>
-</ul>
+{{Compat("api.Notification")}}
<h2 id="请参见">请参见</h2>