OLD | NEW |
1 <h1>Rich Notifications</h1> | 1 <h1>Rich Notifications</h1> |
2 | 2 |
3 <p class="warning"><b>Warning:</b> | 3 <p class="warning"><b>Warning:</b> |
4 <code>webKitNotifications.createHTMLNotification()</code> in the | 4 <code>webKitNotifications.createHTMLNotification()</code> in the |
5 <a href="http://www.chromium.org/developers/design-documents/desktop-notificatio
ns/api-specification">web notifications API</a> has been deprecated. | 5 <a href="http://www.chromium.org/developers/design-documents/desktop-notificatio
ns/api-specification">web notifications API</a> has been deprecated. |
6 The new <a href="http://www.w3.org/TR/notifications/">web notifications API</a>
only allows text. | 6 The new <a href="http://www.w3.org/TR/notifications/">web notifications API</a>
only allows text. |
7 <a href="notifications">Chrome notifications API</a> | 7 <a href="notifications">Chrome notifications API</a> |
8 will be promoted to stable soon and | 8 will be promoted to stable soon and |
9 web notifications will be updated | 9 web notifications will be updated |
10 to use the new rich notifications format. | 10 to use the new rich notifications format. |
(...skipping 30 matching lines...) Expand all Loading... |
41 <p>First, declare the <code>notifications</code> permission in your manifest:</p
> | 41 <p>First, declare the <code>notifications</code> permission in your manifest:</p
> |
42 <pre data-filename="manifest.json"> | 42 <pre data-filename="manifest.json"> |
43 { | 43 { |
44 "name": "My extension", | 44 "name": "My extension", |
45 "manifest_version": 2, | 45 "manifest_version": 2, |
46 ... | 46 ... |
47 <b> "permissions": [ | 47 <b> "permissions": [ |
48 "notifications" | 48 "notifications" |
49 ]</b>, | 49 ]</b>, |
50 ... | 50 ... |
51 // <strong>Note:</strong> Because of <a href="http://code.google.com/p/chromiu
m/issues/detail?id=134315">bug 134315</a>, you must declare any images you | 51 // <strong>Note:</strong> Because of <a href="http://bugs.chromium.org/p/chrom
ium/issues/detail?id=134315">bug 134315</a>, you must declare any images you |
52 // want to use with createNotification() as a web accessible resource. | 52 // want to use with createNotification() as a web accessible resource. |
53 <b> "web_accessible_resources": [ | 53 <b> "web_accessible_resources": [ |
54 "48.png" | 54 "48.png" |
55 ]</b>, | 55 ]</b>, |
56 } | 56 } |
57 </pre> | 57 </pre> |
58 | 58 |
59 <p>Then, use <code>webkitNotifications</code> object to create notifications:</p
> | 59 <p>Then, use <code>webkitNotifications</code> object to create notifications:</p
> |
60 | 60 |
61 <pre> | 61 <pre> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 and for help in viewing the source code, | 114 and for help in viewing the source code, |
115 see <a href="samples">Samples</a>. | 115 see <a href="samples">Samples</a>. |
116 </p> | 116 </p> |
117 | 117 |
118 <p> | 118 <p> |
119 Also see html5rocks.com's | 119 Also see html5rocks.com's |
120 <a href="http://www.html5rocks.com/tutorials/notifications/quick/">notifications
tutorial</a>. | 120 <a href="http://www.html5rocks.com/tutorials/notifications/quick/">notifications
tutorial</a>. |
121 Ignore the permission-related code; | 121 Ignore the permission-related code; |
122 it's unnecessary if you declare the "notifications" permission. | 122 it's unnecessary if you declare the "notifications" permission. |
123 </p> | 123 </p> |
OLD | NEW |