aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/domapplicationsregistry/install
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
commita065e04d529da1d847b5062a12c46d916408bf32 (patch)
treefe0f8bcec1ff39a3c499a2708222dcf15224ff70 /files/es/web/api/domapplicationsregistry/install
parent218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (diff)
downloadtranslated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.gz
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.bz2
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.zip
update based on https://github.com/mdn/yari/issues/2028
Diffstat (limited to 'files/es/web/api/domapplicationsregistry/install')
-rw-r--r--files/es/web/api/domapplicationsregistry/install/index.html90
1 files changed, 0 insertions, 90 deletions
diff --git a/files/es/web/api/domapplicationsregistry/install/index.html b/files/es/web/api/domapplicationsregistry/install/index.html
deleted file mode 100644
index 56f18e777b..0000000000
--- a/files/es/web/api/domapplicationsregistry/install/index.html
+++ /dev/null
@@ -1,90 +0,0 @@
----
-title: Apps.install
-slug: Web/API/DOMApplicationsRegistry/install
-translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/install
----
-<div>
- {{ ApiRef() }} {{non-standard_header}}</div>
-<h2 id="Summary" name="Summary">Resumen</h2>
-<p>Activa la instalación de una aplicación. Durante este proceso la aplicación es validada y el usuario se le solicita aprovar la instalación .</p>
-<p>Si la aplicación estaba previamente instalada desde el mismo dominio, llamando <code>install()</code>otra vez puede silenciosamente reescribir los datos de instalación. This can be used to modify the purchase receipt, for example, when a user upgrades from a free app to a premium app.</p>
-<h2 id="Syntax" name="Syntax">Syntax</h2>
-<pre class="syntaxbox"><code>var <em>request</em> = window.navigator.mozApps.install(<em>url</em>, <em>[receipt1, …]</em>)</code>;</pre>
-<h3 id="Parameters" name="Parameters">Parameters</h3>
-<div class="note">
- <strong>Note:</strong> There is currently (May 2012) a bug with passing a relative path in the <code>url</code> parameter. See {{ Bug("745928") }}.</div>
-<dl>
- <dt>
- <code>url</code></dt>
- <dd>
- A <a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a> URL containing the location of the <a href="/en-US/docs/Web/Apps/Manifest">manifest</a> to be installed. In the case of self distribution (where the installing origin is the same as the app origin), the installing site may omit the origin part of the URL and provide an absolute path (beginning with <code>/</code>).</dd>
- <dt>
- <code><strong>receipts</strong></code></dt>
- <dd>
- (Optional) An array of one or more receipts. Example:</dd>
- <dd>
- <pre>window.navigator.mozApps.install(url, ["receipt"])</pre>
- </dd>
- <dd>
- If <code>receipts</code> is omitted it is treated as <code>null</code>. For more information see <a href="/en-US/docs/Web/Apps/Publishing/Validating_a_receipt">Validating a receipt</a>.</dd>
-</dl>
-<p>The <code>install()</code> function throws an exception if the required argument (<code>url</code>) is missing, or if unsupported arguments are present.</p>
-<h2 id="Returns" name="Returns">Returns</h2>
-<p>The <code>install()</code> function returns a {{ domxref("DOMRequest") }} object. The <code>DOMRequest.result</code> field contains an <a href="/en-US/docs/Web/API/App"><code>App</code> object</a>, which is a JavaScript object that describes the app that was just installed. Before the operation is finished, <code>DOMRequest.result</code> is <code>null</code>.</p>
-<p>If the installation is not successful, <code>DOMRequest.error</code> contains a <a href="/en-US/docs/Web/Apps/JavaScript_API/Error_object"><code>DOMError</code> object</a>, which has information about the error.</p>
-<h2 id="Example" name="Example">Example</h2>
-<p>An example that shows how to use <code>install()</code> with the <code>DOMRequest.onsuccess</code> and <code>DOMRequest.onerror</code> callback properties.</p>
-<pre class="brush: js">var request = window.navigator.mozApps.install(manifestUrl);
-request.onsuccess = function () {
- // Save the App object that is returned
- var appRecord = this.result;
- alert('Installation successful!');
-};
-request.onerror = function () {
- // Display the error information from the DOMError object
- alert('Install failed, error: ' + this.error.name);
-};
-</pre>
-<p>The <code>onsuccess</code> callback is called if the installation is successful. This means that the installation actions described <a href="/en-US/docs/Web/Apps/Platform-specific_details">here</a> have occurred.</p>
-<p>If the installation is not successful the <code>onerror</code> callback is called. On a failed installation, <code>DOMRequest.error</code> contains a <code>DOMError</code> object that has information about the error.</p>
-<p>The code above may look unusual to you, with listeners being added after the function has already been invoked. However, this is the way the <code>DOMRequest</code> object operates. The function invocation will wait until the listeners are defined, and then the listeners will fire appropriately. The <code>install()</code> function also works by itself, without the <code>.onsuccess</code> and <code>.onerror</code> listeners.</p>
-<h2 id="Error" name="Error">Errors</h2>
-<p>When the installation is unsuccessful, one of the following errors can be returned in <code>DOMRequest.error</code>.</p>
-<dl>
- <dt>
- <code>DENIED</code></dt>
- <dd>
- The user cancelled the installation.</dd>
- <dt>
- <code>INVALID_MANIFEST</code></dt>
- <dd>
- The manifest, while well-formed JSON, does not have some required field or is somehow invalid.</dd>
- <dt>
- <code>MANIFEST_URL_ERROR</code></dt>
- <dd>
- Something other than an HTTP 200 status code was received, or some connection errors.</dd>
- <dt>
- <code>MANIFEST_PARSE_ERROR</code></dt>
- <dd>
- Bad JSON in the manifest.</dd>
- <dt>
- <code>NETWORK_ERROR</code></dt>
- <dd>
- Connection error.</dd>
- <dt>
- <code>REINSTALL_FORBIDDEN</code></dt>
- <dd>
- Reinstalls of apps are forbidden.</dd>
- <dt>
- <code>MULTIPLE_APPS_PER_ORIGIN_FORBIDDEN</code></dt>
- <dd>
- Installable apps have a "single app per origin" security policy; basically, you can't host more than one installable app per origin.</dd>
-</dl>
-<h2 id="Related_topics" name="Related_topics">Related topics</h2>
-<ul>
- <li><a href="/en-US/docs/Web/Apps/Publishing/Validating_a_receipt">Validating a receipt</a></li>
- <li><a href="/en-US/docs/Web/Apps/Platform-specific_details">Platform-specific details</a></li>
- <li><a href="/en-US/docs/Web/API/App">App object</a></li>
- <li><a href="/en-US/docs/Web/API/DOMError">DOMError object</a></li>
- <li><a href="/en-US/docs/Web/Apps/JavaScript_API">Apps JavaScript API</a></li>
-</ul>