Apps JavaScript API

  • Enlace amigable (slug) de la revisión: Aplicaciones/Apps_JavaScript_API
  • Título de la revisión: Apps JavaScript API
  • Id de la revisión: 346747
  • Creada:
  • Creador: mserracaldentey
  • ¿Es la revisión actual? No
  • Comentario

Contenido de la revisión

El API JavaScript de Aplicaciones Web Abiertas es un interfaz de  programación para instalar aplicaciones Web y administrar la colección de aplicaciones web del lado del cliente que el usuario ha instalado. Esta colección se llama repositorio de la aplicación,  application repository.

Características disponibles

El API JavaScript descrito aquí todavía no está disponible en la versión publicada de  Firefox (). La versión actual de Firefox (17) tiene una versión anterior de esta que está obsoleta. Puede probar esta API ahora utilizando Firefox Beta para  Windows y Mac, y Firefox Aurora (pre-beta) para Android.

Mozilla también ha implementado implementado un prototipo de repositorio (o "dashboard") en myapps.mozillalabs.com para pruebas y experimentación.

Metodos del API

A todos lo metodos relacionados con las  apps se accede desde el objeto navigator.mozApps . Hay dos tipos de funciones disponibles en la API:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

prototype repository (or "dashboard") at myapps.mozillalabs.com for testing and experimentation.

Methods of the API

All methods related to apps are accessed from the navigator.mozApps object. There are two types of functions available in the API:

  • Installation Functions: related to the installation or management of installed apps. These are interesting to stores, self-distributing apps, and app directories.
  • Management Functions: related to the display, launch, or synchronization of apps. Primarily used by dashboards.

Installation API (navigator.mozApps.*)

The apps installation API is exposed as methods on the window.navigator.mozApps object.

Management API (navigator.mozApps.mgmt.*)

The apps management API is privileged. It is intended to grant access to trusted pages, also called "dashboards". The management API exposes functions that let dashboards manage and launch apps on a user's behalf. Additionally, the API exposes functions for app sync, which lets the dashboard display the logged-in state of the user and allows the user to sign up or register for an account to synchronize apps across devices.

Objects

These types of JavaScript objects are used by the apps API:

Old API and the new API

If you were using the older API, it is obsolete as of . The old API is compared with the new API below.

navigator.mozApps.install()
This function has a changed signature.
navigator.mozApps.amInstalled() {{ obsolete_inline() }}
Replaced by navigator.mozApps.getSelf().
navigator.mozApps.getInstalledBy() {{ obsolete_inline() }}
Replaced by navigator.mozApps.getInstalled().
navigator.mozApps.mgmt.list() {{ obsolete_inline() }}
Replaced by navigator.mozApps.mgmt.getAll().
navigator.mozApps.mgmt.watchUpdates(onupdate) {{ obsolete_inline() }}
navigator.mozApps.mgmt.clearWatch(watchId) {{ obsolete_inline() }}
Both of these replaced by navigator.mozApps.addEventListener(type, cb) and navigator.mozApps.removeEventListener(type, cb) where type can be either install or uninstall.
navigator.mozApps.mgmt.uninstall(origin, [onsuccess], [onerror]) {{ obsolete_inline() }}
Replaced by app.uninstall() where app is an object returned by getAll() or getInstalled().

Fuente de la revisión

<p>El API JavaScript de Aplicaciones Web Abiertas es un interfaz de&nbsp; programación para instalar aplicaciones Web y administrar la colección de aplicaciones web del lado del cliente que el usuario ha instalado. Esta colección se llama repositorio de la aplicación,&nbsp; <em>application repository</em>.</p>
<h2 id="Feature_availability" name="Feature_availability">Características disponibles</h2>
<p>El API JavaScript descrito aquí todavía no está disponible en la versión publicada de&nbsp; Firefox (<time datetime="2012-11">Noviembre 2012</time>). La versión actual de Firefox (17) tiene una versión anterior de esta que está obsoleta. Puede probar esta API ahora utilizando <a href="http://www.mozilla.org/en-US/firefox/beta/">Firefox Beta</a> para&nbsp; Windows y Mac, y <a href="http://www.mozilla.org/en-US/firefox/aurora/">Firefox Aurora</a> (pre-beta) para Android.</p>
<p>Mozilla también ha implementado implementado un prototipo de repositorio (o "dashboard") en <a class="link-https" href="https://myapps.mozillalabs.com/"><code>myapps.mozillalabs.com</code></a> para pruebas y experimentación.</p>
<h2 id="Methods_of_the_API">Metodos del API</h2>
<p>A todos lo metodos relacionados con las&nbsp; <em>apps</em> se accede desde el objeto <code>navigator.mozApps</code> . Hay dos tipos de funciones disponibles en la API:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>prototype repository (or "dashboard") at <a class="link-https" href="https://myapps.mozillalabs.com/"><code>myapps.mozillalabs.com</code></a> for testing and experimentation.</p>
<h2 id="Methods_of_the_API">Methods of the API</h2>
<p>All methods related to apps are accessed from the <code>navigator.mozApps</code> object. There are two types of functions available in the API:</p>
<ul>
  <li><a href="#Installation_API"><strong>Installation Functions</strong></a>: related to the installation or management of installed apps. These are interesting to stores, self-distributing apps, and app directories.</li>
  <li><a href="#Management_API"><strong>Management Functions</strong></a>: related to the display, launch, or synchronization of apps. Primarily used by dashboards.</li>
</ul>
<h2 id="Installation_API" name="Installation_API">Installation API (<code>navigator.mozApps.*</code>)</h2>
<p>The apps installation API is exposed as methods on the <a href="/en-US/docs/DOM/window.navigator.mozApps"><code>window.navigator.mozApps</code></a> object.</p>
<ul>
  <li><a href="/en-US/docs/DOM/Apps.install"><code>navigator.mozApps.install()</code></a></li>
  <li><a href="/en-US/docs/DOM/Apps.installPackage"><code>navigator.mozApps.installPackage()</code></a></li>
  <li><a href="/en-US/docs/DOM/Apps.getSelf"><code>navigator.mozApps.getSelf()</code></a></li>
  <li><a href="/en-US/docs/DOM/Apps.getInstalled"><code>navigator.mozApps.getInstalled()</code></a></li>
</ul>
<h2 id="Management_API" name="Management_API">Management API (<code>navigator.mozApps.mgmt.*</code>)</h2>
<p>The apps management API is privileged. It is intended to grant access to trusted pages, also called "dashboards". The management API exposes functions that let dashboards manage and launch apps on a user's behalf. Additionally, the API exposes functions for app sync, which lets the dashboard display the logged-in state of the user and allows the user to sign up or register for an account to synchronize apps across devices.</p>
<ul>
  <li><a href="/en-US/docs/DOM/Apps.mgmt.getAll"><code>navigator.mozApps.mgmt.getAll()</code></a></li>
</ul>
<h2 id="Objects" name="Objects">Objects</h2>
<p>These types of JavaScript objects are used by the apps API:</p>
<ul>
  <li><a href="/en-US/docs/DOM/App">App objects</a> represent apps.</li>
  <li><a href="/en-US/docs/DOM/DOMRequest">DOMRequest</a> objects are returned by several methods.</li>
  <li><a href="/en-US/docs/DOM/DOMError">DOMError objects</a> represent errors returned by methods.</li>
</ul>
<h2 id="Old_API_and_the_new_API" name="Old_API_and_the_new_API">Old API and the new API</h2>
<p>If you were using the older API, it is obsolete as of <time datetime="2012-03">March 2012</time>. The old API is compared with the new API below.</p>
<dl>
  <dt>
    <a href="/en-US/docs/DOM/Apps.install">navigator.mozApps.install()</a></dt>
  <dd>
    This function has a changed signature.</dd>
  <dt>
    <a href="/en-US/docs/Apps/Apps_JavaScript_API/navigator.mozApps.amInstalled">navigator.mozApps.amInstalled()</a> {{ obsolete_inline() }}</dt>
  <dd>
    Replaced by <a href="/en-US/docs/DOM/Apps.getSelf"><code>navigator.mozApps.getSelf()</code></a>.</dd>
  <dt>
    <a href="/en-US/docs/Apps/Apps_JavaScript_API/navigator.mozApps.getInstalledBy">navigator.mozApps.getInstalledBy()</a> {{ obsolete_inline() }}</dt>
  <dd>
    Replaced by <a href="/en-US/docs/DOM/Apps.getInstalled"><code>navigator.mozApps.getInstalled()</code></a>.</dd>
  <dt>
    <a href="/en-US/docs/Apps/Apps_JavaScript_API/navigator.mozApps.mgmt.list">navigator.mozApps.mgmt.list()</a> {{ obsolete_inline() }}</dt>
  <dd>
    Replaced by <a href="/en-US/docs/DOM/Apps.mgmt.getAll"><code>navigator.mozApps.mgmt.getAll()</code></a>.</dd>
  <dt>
    <a href="/en-US/docs/Apps/Apps_JavaScript_API/navigator.mozApps.mgmt.watchUpdates">navigator.mozApps.mgmt.watchUpdates(onupdate)</a> {{ obsolete_inline() }}<br />
    <a href="/en-US/docs/Apps/Apps_JavaScript_API/navigator.mozApps.mgmt.clearWatch">navigator.mozApps.mgmt.clearWatch(watchId)</a> {{ obsolete_inline() }}</dt>
  <dd>
    Both of these replaced by <a href="/en-US/docs/DOM/Apps.mgmt.addEventListener"><code>navigator.mozApps.addEventListener(type, cb)</code></a> and <a href="/en-US/docs/DOM/Apps.mgmt.removeEventListener"><code>navigator.mozApps.removeEventListener(type, cb)</code></a> where <code>type</code> can be either <code>install</code> or <code>uninstall</code>.</dd>
  <dt>
    <a href="/en-US/docs/Apps/Apps_JavaScript_API/navigator.mozApps.mgmt.uninstall">navigator.mozApps.mgmt.uninstall(origin, [onsuccess], [onerror])</a> {{ obsolete_inline() }}</dt>
  <dd>
    Replaced by <code>app.uninstall()</code> where <code>app</code> is an object returned by <a href="/en-US/docs/DOM/Apps.mgmt.getAll"><code>getAll()</code></a> or <code><a href="/en-US/docs/DOM/Apps.getInstalled">getInstalled()</a></code>.</dd>
</dl>
Revertir a esta revisión