navigator.mozNotification

  • Revision slug: DOM/navigator.mozNotification
  • Revision title: navigator.mozNotification
  • Revision id: 92962
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 7 words added

Revision Content

{{ gecko_minversion_header("2.0") }}{{ MobileOnlyHeader("2.0") }}{{ non-standard_header() }}

Provides support for creating {{ domxref("notification") }} objects, which are used to display desktop notification alerts to the user. Currently, these are only supported on Firefox Mobile. See Displaying notifications for an example.

Method overview

notification createNotification(in DOMString title, in DOMString description, in DOMString iconURL {{ optional_inline() }});

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 iconURL {{ optional_inline() }}
);
Parameters
title
The notification title.
description
The text to display in the notification.
iconURL {{ optional_inline() }}
A URL identifying the image to display in the notification.
Return value

A new {{ domxref("notification") }} object.

See also

Revision Source

<p>{{ gecko_minversion_header("2.0") }}{{ MobileOnlyHeader("2.0") }}{{ non-standard_header() }}</p>
<p>Provides support for creating {{ domxref("notification") }} objects, which are used to display desktop notification alerts to the user. Currently, these are only supported on Firefox Mobile. See <a href="/en/DOM/Displaying_notifications" title="en/DOM/Displaying notifications">Displaying notifications</a> for an example.</p>
<h2 id="Method_overview" name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>notification <a href="#createNotification()">createNotification</a>(in DOMString title, in DOMString description, in DOMString iconURL {{ optional_inline() }});</code></td> </tr> </tbody>
</table>
<h2 id="Methods" name="Methods">Methods</h2>
<h3 id="createNotification()" name="createNotification()">createNotification()</h3>
<p>Creates and returns a notification object that can be used to display the specified message with an optional URL.</p>
<pre class="eval">notification createNotification(
  in DOMString title,
  in DOMString description,
  in DOMString iconURL {{ optional_inline() }}
);
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl> <dt><code>title</code></dt> <dd>The notification title.</dd> <dt><code>description</code></dt> <dd>The text to display in the notification.</dd> <dt><code>iconURL</code> {{ optional_inline() }}</dt> <dd>A URL identifying the image to display in the notification.</dd>
</dl>
<h6 id="Return_value" name="Return_value">Return value</h6>
<p>A new {{ domxref("notification") }} object.</p>
<h2 id="See_also">See also</h2>
<ul> <li>{{ domxref("notification") }}</li> <li><a href="/en/DOM/Displaying_notifications" title="en/DOM/Displaying notifications">Displaying notifications</a></li>
</ul>
Revert to this revision