> [!WARNING]
> **Warning:** You're viewing the deprecated Manifest V2 version of this article. See [Manifest V3 - Rich notifications](https://developer.chrome.com/docs/extensions/how-to/ui/notifications) for the MV3 equivalent. The Chrome Web Store no longer accepts Manifest V2 extensions. Follow the [Manifest V3 Migration guide](https://developer.chrome.com/docs/extensions/develop/migrate) to convert your extension to Manifest V3.

> [!WARNING]
> **Warning:** **Warning:** `webKitNotifications.createHTMLNotification()` in the [web notifications API](http://www.chromium.org/developers/design-documents/desktop-notifications/api-specification) has been deprecated. The new [web notifications API](http://www.w3.org/TR/notifications/) only allows text. [Chrome notifications API](https://developer.chrome.com/docs/extensions/notifications) will be promoted to stable soon and web notifications will be updated to use the new rich notifications format.

Use rich 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.

![Notifications on Microsoft Windows](https://developer.chrome.com/static/docs/extensions/mv2/desktop-notifications/image/notifications-microsoft-c92a50ed9d7d7.png)

![Notifications on Mac OS X](https://developer.chrome.com/static/docs/extensions/mv2/desktop-notifications/image/notifications-mac-os-x-ad76af2d0106d.png)

![Notifications on Ubuntu Linux](https://developer.chrome.com/static/docs/extensions/mv2/desktop-notifications/image/notifications-ubuntu-lin-34b5e0beed216.png)

You create the notification window using a bit of JavaScript and, optionally, an HTML page packaged
inside your extension.

## Example

First, declare the `notifications` permission in your manifest:

    {
      "name": "My extension",
      "manifest_version": 2,
      ...
      "permissions": [
        "notifications"
      ],
      ...
      // Note: Because of bug 134315, you must declare any images you
      // want to use with createNotification() as a web accessible resource.
      "web_accessible_resources": [
        "48.png"
      ],
    }

Then, use `webkitNotifications` object to create notifications:

    // Note: There's no need to call webkitNotifications.checkPermission().
    // Extensions that declare the notifications permission are always
    // allowed to 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();

## API reference

See the [Desktop Notifications Draft Specification](http://dev.chromium.org/developers/design-documents/desktop-notifications/api-specification).

## Communicating with other views

You can communicate between a notification and other views in your extension using
[extension.getBackgroundPage](https://developer.chrome.com/docs/extensions/mv2/reference/extension#method-getBackgroundPage) and [extension.getViews](https://developer.chrome.com/docs/extensions/mv2/reference/extension#method-getViews). For example:

    chrome.extension.getBackgroundPage().doThing();

    chrome.extension.getViews({type:"notification"}).forEach(function(win) {
      win.doOtherThing();
    });

## More examples

You can find a simple example of using notifications in the [examples/api/notifications](https://github.com/GoogleChrome/chrome-extensions-samples/tree/master/_archive/mv2/api/notifications/)
directory. For other examples and for help in viewing the source code, see [Samples](https://developer.chrome.com/docs/extensions/mv2/samples).

Also see html5rocks.com's [notifications tutorial](http://www.html5rocks.com/tutorials/notifications/quick/). Ignore the permission-related code; it's
unnecessary if you declare the "notifications" permission.