Apps.getSelf

  • Revision slug: DOM/Apps.getSelf
  • Revision title: Apps.getSelf
  • Revision id: 235131
  • Created:
  • Creator: MarkGiffin
  • Is current revision? No
  • Comment 2 words added

Revision Content

{{ DomRef() }}

{{ non-standard_header() }}

Summary

Returns an object that contains an App object for the app.

Syntax

var request = window.navigator.mozApps.getSelf();

Parameters

None.

Example

var request = window.navigator.mozApps.getSelf(); 
request.onerror = function(e) {
  alert("Error installing app: " + request.error.name);
};
request.onsuccess = function(e) {
  alert("Success installing app: " + request.result.manifest.name);
  var appRecord = request.result;
};

Callers are expected to set the onsuccess and onerror callback properties of the returned object, as shown in this example. If the call is successful an App object is returned in the result property of the returned object. In this example this is request.result.

Related topics

Apps JavaScript API

Revision Source

<p>{{ DomRef() }}</p>
<p>{{ non-standard_header() }}</p>
<h2>Summary</h2>
<p>Returns an object that contains an <a href="/en/DOM/App" title="https://developer.mozilla.org/en/Apps/Apps_JavaScript_API/app_object"><code>App</code> object</a> for the app.</p>
<h2>Syntax</h2>
<pre><code>var request = window.navigator.mozApps.getSelf()</code>;
</pre>
<h2>Parameters</h2>
<p>None.</p>
<h2>Example</h2>
<pre class="brush: js">var request = window.navigator.mozApps.getSelf(); 
request.onerror = function(e) {
  alert("Error installing app: " + request.error.name);
};
request.onsuccess = function(e) {
  alert("Success installing app: " + request.result.manifest.name);
  var appRecord = request.result;
};</pre>
<p>Callers are expected to set the <code>onsuccess</code> and <code>onerror</code> callback properties of the returned object, as shown in this example. If the call is successful an <a href="/en/DOM/App" title="https://developer.mozilla.org/en/Apps/Apps_JavaScript_API/app_object"><code>App</code></a> object is returned in the <code>result</code> property of the returned object. In this example this is <code>request.result</code>.</p>
<h2>Related topics</h2>
<p><a href="/en/Apps/Apps_JavaScript_API" title="https://developer.mozilla.org/en/Apps/Apps_JavaScript_API">Apps JavaScript API</a></p>
Revert to this revision