Navigator.mozNotification

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Obsolete since Gecko 22 (Firefox 22 / Thunderbird 22 / SeaMonkey 2.19)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Mobile Only in Gecko 2.0
Available only in Firefox Mobile as of Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Provides support for creating notification objects, which are used to display desktop notification alerts to the user. Currently, these are only supported on Firefox Mobile and Firefox OS. See Displaying notifications for an example.

The support for this property as been dropped in favor of the standard Notification constructor.

Method overview

notification createNotification(in DOMString title, in DOMString description, in DOMString iconURL Optional);

Methods

createNotification()

Creates and returns a notification object that can be used to display the specified message with an optional URL.

notification createNotification(
  in DOMString title,
  in DOMString description,
  in DOMString iconURLOptional
);

Parameters

title
The notification title.
description
The text to display in the notification.
iconURL Optional
A URL identifying the image to display in the notification.

Return value

A new notification object.

Permissions

When using notifications in an open web app, be sure to add the desktop-notification permission in your manifest file:

"permissions": {
    "desktop-notification": {}
}

Usage notes

  • In Firefox 22+, the instantiation of a new notification should be done with the Notification object by calling new Notification(title, options).
  • Nick Desaulniers has written a Notification shim to cover both newer and older implementations.

See also