| Index: chrome/common/extensions/docs/templates/articles/notifications.html
|
| diff --git a/chrome/common/extensions/docs/templates/articles/notifications.html b/chrome/common/extensions/docs/templates/articles/notifications.html
|
| deleted file mode 100644
|
| index 84161e9d1a6becd6a644a273e3024725cc28519e..0000000000000000000000000000000000000000
|
| --- a/chrome/common/extensions/docs/templates/articles/notifications.html
|
| +++ /dev/null
|
| @@ -1,116 +0,0 @@
|
| -<h1>Desktop Notifications</h1>
|
| -
|
| -
|
| -
|
| -<p>
|
| -Use desktop notifications to notify users that something
|
| -important has happened.
|
| -Notifications appear outside the browser window.
|
| -As the following snapshots show,
|
| -the details of how notifications look
|
| -and where they're shown depend on the platform.
|
| -</p>
|
| -
|
| -<img src="{{static}}/images/notification-windows.png"
|
| - width="28%" style="margin:2em 0.5em 1em; border:1px solid black;"
|
| - alt="Notifications on Microsoft Windows"/>
|
| -<img src="{{static}}/images/notification-mac.png"
|
| - width="28%" style="margin:2em 0.5em 1em; border:1px solid black;"
|
| - alt="Notifications on Mac OS X"/>
|
| -<img src="{{static}}/images/notification-linux.png"
|
| - width="28%" style="margin:2em 0.5em 1em; border:1px solid black;"
|
| - alt="Notifications on Ubuntu Linux"/>
|
| -
|
| -<p>
|
| -You create the notification window
|
| -using a bit of JavaScript and, optionally,
|
| -an HTML page packaged inside your extension.
|
| -</p>
|
| -
|
| -
|
| -<h2 id="example">Example</h2>
|
| -
|
| -<p>First, declare the <code>notifications</code> permission in your manifest:</p>
|
| -<pre>
|
| -{
|
| - "name": "My extension",
|
| - "manifest_version": 2,
|
| - ...
|
| -<b> "permissions": [
|
| - "notifications"
|
| - ]</b>,
|
| - ...
|
| - // <strong>Note:</strong> Because of <a href="http://code.google.com/p/chromium/issues/detail?id=134315">bug 134315</a>, you must declare any images you
|
| - // want to use with createNotification() as a web accessible resource.
|
| -<b> "web_accessible_resources": [
|
| - "48.png"
|
| - ]</b>,
|
| -}
|
| -</pre>
|
| -
|
| -<p>Then, use <code>webkitNotifications</code> object to create notifications:</p>
|
| -
|
| -<pre>
|
| -// <strong>Note:</strong> There's no need to call webkitNotifications.checkPermission().
|
| -// Extensions that declare the <em>notifications</em> permission are always
|
| -// allowed create notifications.
|
| -
|
| -// Create a simple text notification:
|
| -var notification = webkitNotifications.createNotification(
|
| - '48.png', // icon url - can be relative
|
| - 'Hello!', // notification title
|
| - 'Lorem ipsum...' // notification body text
|
| -);
|
| -
|
| -// Or create an HTML notification:
|
| -var notification = webkitNotifications.createHTMLNotification(
|
| - 'notification.html' // html url - can be relative
|
| -);
|
| -
|
| -// Then show the notification.
|
| -notification.show();
|
| -</pre>
|
| -
|
| -<h2 id="reference">API Reference</h2>
|
| -
|
| -<p>See the <a href="http://dev.chromium.org/developers/design-documents/desktop-notifications/api-specification">Desktop Notifications Draft Specification</a>.</p>
|
| -
|
| -
|
| -<h2 id="communication">Communicating with Other Views</h2>
|
| -
|
| -<p>
|
| -You can communicate between a notification
|
| -and other views in your extension using
|
| -$ref:extension.getBackgroundPage and
|
| -$ref:extension.getViews. For example:
|
| -</p>
|
| -
|
| -<pre>
|
| -// Inside a notification...
|
| -chrome.extension.getBackgroundPage().doThing();
|
| -
|
| -// From the background page...
|
| -chrome.extension.getViews({type:"notification"}).forEach(function(win) {
|
| - win.doOtherThing();
|
| -});
|
| -</pre>
|
| -
|
| -
|
| -<h2 id="examples">More Examples</h2>
|
| -
|
| -<p>
|
| -You can find a simple example
|
| -of using notifications in the
|
| -<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/notifications/">examples/api/notifications</a>
|
| -directory.
|
| -For other examples
|
| -and for help in viewing the source code,
|
| -see <a href="samples.html">Samples</a>.
|
| -</p>
|
| -
|
| -<p>
|
| -Also see html5rocks.com's
|
| -<a href="http://www.html5rocks.com/tutorials/notifications/quick/">notifications tutorial</a>.
|
| -Ignore the permission-related code;
|
| -it's unnecessary if you declare the "notifications" permission.
|
| -</p>
|
|
|