From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../web/api/cameracapabilities/effects/index.html | 37 ---- .../api/cameracapabilities/fileformats/index.html | 37 ---- .../api/cameracapabilities/flashmodes/index.html | 37 ---- files/es/web/api/cameracapabilities/index.html | 86 -------- .../maxexposurecompensation/index.html | 33 --- .../cameracapabilities/maxfocusareas/index.html | 33 --- .../checkinstalled/index.html | 49 ----- .../getinstalled/index.html | 40 ---- .../es/web/api/domapplicationsregistry/index.html | 89 -------- .../api/domapplicationsregistry/install/index.html | 90 -------- .../installpackage/index.html | 36 ---- files/es/web/api/mozsocial/closepanel/index.html | 19 -- files/es/web/api/mozsocial/getattention/index.html | 19 -- files/es/web/api/mozsocial/getworker/index.html | 19 -- files/es/web/api/mozsocial/index.html | 44 ---- files/es/web/api/mozsocial/isvisible/index.html | 22 -- .../es/web/api/mozsocial/openchatwindow/index.html | 26 --- files/es/web/api/mozsocial/openpanel/index.html | 30 --- files/es/web/api/navigator/id/index.html | 16 -- files/es/web/api/navigator/mozsocial/index.html | 48 ----- files/es/web/api/simple_push_api/index.html | 235 --------------------- files/es/web/api/using_the_browser_api/index.html | 159 -------------- 22 files changed, 1204 deletions(-) delete mode 100644 files/es/web/api/cameracapabilities/effects/index.html delete mode 100644 files/es/web/api/cameracapabilities/fileformats/index.html delete mode 100644 files/es/web/api/cameracapabilities/flashmodes/index.html delete mode 100644 files/es/web/api/cameracapabilities/index.html delete mode 100644 files/es/web/api/cameracapabilities/maxexposurecompensation/index.html delete mode 100644 files/es/web/api/cameracapabilities/maxfocusareas/index.html delete mode 100644 files/es/web/api/domapplicationsregistry/checkinstalled/index.html delete mode 100644 files/es/web/api/domapplicationsregistry/getinstalled/index.html delete mode 100644 files/es/web/api/domapplicationsregistry/index.html delete mode 100644 files/es/web/api/domapplicationsregistry/install/index.html delete mode 100644 files/es/web/api/domapplicationsregistry/installpackage/index.html delete mode 100644 files/es/web/api/mozsocial/closepanel/index.html delete mode 100644 files/es/web/api/mozsocial/getattention/index.html delete mode 100644 files/es/web/api/mozsocial/getworker/index.html delete mode 100644 files/es/web/api/mozsocial/index.html delete mode 100644 files/es/web/api/mozsocial/isvisible/index.html delete mode 100644 files/es/web/api/mozsocial/openchatwindow/index.html delete mode 100644 files/es/web/api/mozsocial/openpanel/index.html delete mode 100644 files/es/web/api/navigator/id/index.html delete mode 100644 files/es/web/api/navigator/mozsocial/index.html delete mode 100644 files/es/web/api/simple_push_api/index.html delete mode 100644 files/es/web/api/using_the_browser_api/index.html (limited to 'files/es/web/api') diff --git a/files/es/web/api/cameracapabilities/effects/index.html b/files/es/web/api/cameracapabilities/effects/index.html deleted file mode 100644 index 1204fb0c34..0000000000 --- a/files/es/web/api/cameracapabilities/effects/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: CameraCapabilities.effects -slug: Web/API/CameraCapabilities/effects -translation_of: Archive/B2G_OS/API/CameraCapabilities/effects ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

Resumen

-

El valor de la propiedad effects en un Array que identifica los efectos  (tales como normal, sepia, mono, etc.) que soporta la camara.

-

Sintaxis

-
var effects = instanceOfCameraControl.capabilities.effects
-

Valor

-

Devuelve un Array de cadenas.

-

Ejemplo

-
var options = {
-  camera: navigator.mozCameras.getListOfCameras()[0]
-};
-
-function onSuccess(camera) {
-  var effects = camera.capabilities.effects;
-
-  effects.forEach(function (value) {
-    console.log(value)
-  });
-};
-
-navigator.mozCameras.getCamera(options, onSuccess)
-
-

Especifiacion

-

No forma parte de ninguna especifiacion; en cualquier caso, esta API deberia ser eliminada cuando la WebRTC Capture and Stream API haya sido implementada.

-

Ver tambien

- diff --git a/files/es/web/api/cameracapabilities/fileformats/index.html b/files/es/web/api/cameracapabilities/fileformats/index.html deleted file mode 100644 index 5193200866..0000000000 --- a/files/es/web/api/cameracapabilities/fileformats/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: CameraCapabilities.fileFormats -slug: Web/API/CameraCapabilities/fileFormats -translation_of: Archive/B2G_OS/API/CameraCapabilities/fileFormats ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

Summary

-

La propiedad fileFormats es un Array que identifica los formatos de archivo que soporta la camara, tales como jpeg, rgb565, etc.

-

Sintaxis

-
var formats = instanceOfCameraControl.capabilities.fileFormats
-

Valor

-

Devuelve un Array de cadenas.

-

Ejemplo

-
var options = {
-  camera: navigator.mozCameras.getListOfCameras()[0]
-};
-
-function onSuccess(camera) {
-  var formats = camera.capabilities.fileFormats;
-
-  formats.forEach(function (value) {
-    console.log(value)
-  });
-};
-
-navigator.mozCameras.getCamera(options, onSuccess)
-
-

Especificacion

-

No es parte de ninguna especificacion; en cualquier caso, esta API deberia ser eliminada cuando la WebRTC Capture and Stream API haya sido implementada.

-

Ver tambien

- diff --git a/files/es/web/api/cameracapabilities/flashmodes/index.html b/files/es/web/api/cameracapabilities/flashmodes/index.html deleted file mode 100644 index be89eac3ac..0000000000 --- a/files/es/web/api/cameracapabilities/flashmodes/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: CameraCapabilities.flashModes -slug: Web/API/CameraCapabilities/flashModes -translation_of: Archive/B2G_OS/API/CameraCapabilities/flashModes ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

Resumen

-

La propiedad flashModes es un Array de cadenas que identifican cada modo de flash soportado por la camara. Los posibles valores son auto, off, on o torch.

-

Sintaxis

-
var flash = instanceOfCameraControl.capabilities.flashModes
-

Valor

-

Devuelve un  Array de cadenas.

-

Ejemplo

-
var options = {
-  camera: navigator.mozCameras.getListOfCameras()[0]
-};
-
-function onSuccess(camera) {
-  var flash = camera.capabilities.flashModes;
-
-  flash.forEach(function (value) {
-    console.log(value)
-  });
-};
-
-navigator.mozCameras.getCamera(options, onSuccess)
-
-

Especifiacion

-

No es parte de ninguna especificacion; en cualquier caso, esta API deberia ser eliminada cuando la WebRTC Capture and Stream API haya sido implementada.

-

Ver tambien

- diff --git a/files/es/web/api/cameracapabilities/index.html b/files/es/web/api/cameracapabilities/index.html deleted file mode 100644 index a534b51ab5..0000000000 --- a/files/es/web/api/cameracapabilities/index.html +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: CameraCapabilities -slug: Web/API/CameraCapabilities -translation_of: Archive/B2G_OS/API/CameraCapabilities ---- -

{{ Apiref() }}

-

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

The {{domxref("CameraControl.capabilities")}} property returns a CameraCapabilities object, which describes all the camera's capabilities.

-

Properties

-
-
- {{domxref("CameraCapabilities.effects")}} {{readonlyinline}}
-
- An Array of strings identifying the effects (such as normal, sepia, mono, etc.) that the camera supports.
-
- {{domxref("CameraCapabilities.fileFormats")}} {{readonlyinline}}
-
- An Array of strings identifying the file formats supported by the camera, such as jpeg, rgb565, etc.
-
- {{domxref("CameraCapabilities.flashModes")}} {{readonlyinline}}
-
- An Array of strings identifying each of the flash modes supported by the camera. Possible values are auto, off, on or torch.
-
- {{domxref("CameraCapabilities.focusModes")}} {{readonlyinline}}
-
- An Array of strings identifying each of the focus modes supported by the camera such as auto, fixed, macro, etc.
-
- {{domxref("CameraCapabilities.maxExposureCompensation")}} {{readonlyinline}}
-
- A number that defines the maximum supported exposure compensation value.
-
- {{domxref("CameraCapabilities.maxFocusAreas")}} {{readonlyinline}}
-
- A number that defines the maximum number of focus areas supported by the camera.
-
- {{domxref("CameraCapabilities.maxMeteringAreas")}} {{readonlyinline}}
-
- A number that defines the maximum number of metering areas supported by the camera.
-
- {{domxref("CameraCapabilities.minExposureCompensation")}} {{readonlyinline}}
-
- A number that defines the minimum supported exposure compensation value.
-
- {{domxref("CameraCapabilities.pictureSizes")}} {{readonlyinline}}
-
- An Array of objects containing the height and width properties supported for picture taking.
-
- {{domxref("CameraCapabilities.previewSizes")}} {{readonlyinline}}
-
- An Array of objects containing the height and width properties supported for the video preview stream.
-
- {{domxref("CameraCapabilities.recorderProfiles")}} {{readonlyinline}}
-
- An object with attributes for each of the supported recorder profiles.
-
- {{domxref("CameraCapabilities.sceneModes")}} {{readonlyinline}}
-
- An Array of strings identifying each of the scene modes supported by the camera such as auto, night, beach, etc.
-
- {{domxref("CameraCapabilities.stepExposureCompensation")}} {{readonlyinline}}
-
- A number that defines the exposure compensation minimum step-size.
-
- {{domxref("CameraCapabilities.videoSizes")}} {{readonlyinline}}
-
- An Array of objects containing the height and width properties supported for video recording.
-
- {{domxref("CameraCapabilities.whiteBalanceModes")}} {{readonlyinline}}
-
- An Array of strings identifiers for each white balance modes supported by the camera such as auto, fluorecent, etc.
-
- {{domxref("CameraCapabilities.zoomRatios")}} {{readonlyinline}}
-
- An Array of numbers representing all the supported zoom ratios. If the camera has no zoom capabilities, the value is null.
-
-

Methods

-

None.

-

Specification

-

Not part of any specification; however, this API should be removed when the WebRTC Capture and Stream API has been implemented.

-

See also

- diff --git a/files/es/web/api/cameracapabilities/maxexposurecompensation/index.html b/files/es/web/api/cameracapabilities/maxexposurecompensation/index.html deleted file mode 100644 index 2baf025df3..0000000000 --- a/files/es/web/api/cameracapabilities/maxexposurecompensation/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: CameraCapabilities.maxExposureCompensation -slug: Web/API/CameraCapabilities/maxExposureCompensation -translation_of: Archive/B2G_OS/API/CameraCapabilities/maxExposureCompensation ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

Resumen

-

La propiedad maxExposureCompensation es un número que define el valor máximo de compensación de exposición soportado.

-

Sintaxis

-
var max = instanceOfCameraControl.capabilities.maxExposureCompensation
-

Valor

-

Devuelve un número.

-

Ejemplo

-
var options = {
-  camera: navigator.mozCameras.getListOfCameras()[0]
-};
-
-function onSuccess(camera) {
-  console.log(camera.capabilities.maxExposureCompensation);
-};
-
-navigator.mozCameras.getCamera(options, onSuccess)
-
-

Especificación

-

No forma parte de ninguna especificación; No obstante, esta API debería ser eliminada cuando la WebRTC Capture and Stream API haya sido implementada.

-

Ver también

- diff --git a/files/es/web/api/cameracapabilities/maxfocusareas/index.html b/files/es/web/api/cameracapabilities/maxfocusareas/index.html deleted file mode 100644 index 6d0024bebb..0000000000 --- a/files/es/web/api/cameracapabilities/maxfocusareas/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: CameraCapabilities.maxFocusAreas -slug: Web/API/CameraCapabilities/maxFocusAreas -translation_of: Archive/B2G_OS/API/CameraCapabilities/maxFocusAreas ---- -

{{ Apiref() }}

-

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

Resumen

-

La propiedad maxFocusAreas es un numero que define el numero maximo de areas de foco que permite la camara.

-

Sintaxis

-
var max = instanceOfCameraControl.capabilities.maxFocusAreas
-

Valor

-

Devuelve un numero.

-

Ejemplo

-
var options = {
-  camera: navigator.mozCameras.getListOfCameras()[0]
-};
-
-function onSuccess(camera) {
-  console.log(camera.capabilities.maxFocusAreas);
-};
-
-navigator.mozCameras.getCamera(options, onSuccess)
-
-

Especificacion

-

No es parte de ninguna especificacion; en cualquier caso, esta API deberia ser eliminada cuando la  WebRTC Capture and Stream API haya sido implementada.

-

Ver tambien

- diff --git a/files/es/web/api/domapplicationsregistry/checkinstalled/index.html b/files/es/web/api/domapplicationsregistry/checkinstalled/index.html deleted file mode 100644 index 5c2d298aa9..0000000000 --- a/files/es/web/api/domapplicationsregistry/checkinstalled/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Apps.checkInstalled -slug: Web/API/DOMApplicationsRegistry/checkInstalled -tags: - - API - - Apps - - Apps API - - Firefox OS - - Procedimiento -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/checkInstalled ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

Resúmen

-

Obtiene información acerca de la aplicación dada. Esto puede ser usado para determinar si se ha instalado la aplicación.

-

Sintaxis

-
var request = window.navigator.mozApps.checkInstalled(url);
-
-

Parámetros

-
-
- url
-
- Una cadena de URL que contiene la ubicación de el manifiesto de la aplicación.
-
-

Resultados

-

La función checkInstalled() devuelve un objeto {{ domxref("DOMRequest") }}. La propiedad DOMRequest.result contiene un App object, que es un objeto JavaScript que describe la aplicación instalada. Si la aplicación no se encuentra instalada, entonces DOMRequest.result es null (nulo).

-

Ejemplo

-
var request = window.navigator.mozApps.checkInstalled("http://ejemplo.com/manifest.webapp");
-request.onerror = function(e) {
-  alert("Error de llamada checkInstalled: " + request.error.name);
-};
-request.onsuccess = function(e) {
-  if (request.result) {
-    console.log("La aplicación está instalada!");
-  }
-  else {
-    console.log("La aplicación no está instalada!");
-  }
-};
-

Se espera a las personas que llaman para establecer las propiedades de devolución de llamada onsuccess y onerror del objeto devuelto, como se muestra en este ejemplo. Si la llamada se realiza correctamente,  un App object se devuelve en la propiedad result del objeto devuelto. En el ejemplo esto es request.result.

-

Errores

-

La cadena ERROR pueden ser devueltos en DOMRequest.error.

-

Una excepción NS_ERROR_DOM_BAD_URI se produce si el manifiesto está en un dominio diferente a la página en que se solicita la información. Este se produce tan pronto como se invoca checkInstalled.

-

Temas relacionados

- diff --git a/files/es/web/api/domapplicationsregistry/getinstalled/index.html b/files/es/web/api/domapplicationsregistry/getinstalled/index.html deleted file mode 100644 index a1b96ee7ff..0000000000 --- a/files/es/web/api/domapplicationsregistry/getinstalled/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Apps.getInstalled -slug: Web/API/DOMApplicationsRegistry/getInstalled -tags: - - API - - Apps - - Apps API - - Firefox OS - - Procedimiento -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/getInstalled ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

Resumen

-

Obtenga una lista de todas las aplicaciones instaladas desde este origen. Por ejemplo, si se llama a esto en el Firefox Marketplace, obtendrá la lista de aplicaciones instaladas por el Firefox Marketplace.

-
-

Note: Múltiples aplicaciones por origen no son compatibles. Para alojar varias aplicaciones de un dominio, establezca un subdominio para cada aplicación; por ejemplo: miapp.midominio.com, otraapp.midominio.com, y así sucesivamente.

-
-

Sintaxis

-
var request = window.navigator.mozApps.getInstalled();
-
-

Parámetros

-

Ninguno.

-

Ejemplo

-
var request = window.navigator.mozApps.getInstalled();
-request.onerror = function(e) {
-  alert("Error de llamada getInstalled: " + request.error.name);
-};
-request.onsuccess = function(e) {
-  alert("Éxito, numero de apps: " + request.result.length);
-  var appsRecord = request.result;
-};
-

Se espera a las personas que llaman para establecer las propiedades de devolución onsuccess y onerror del objeto devuelto, como se muestra en este ejemplo. Si la llamada se realiza correctamente un array de App objects se devuelve en la propiedad result del objeto devuelto. En el ejemplo esto es request.result.

-

Errores

-

La cadena ERROR puede ser devuelta en DOMRequest.error.

-

Temas relacionados

- diff --git a/files/es/web/api/domapplicationsregistry/index.html b/files/es/web/api/domapplicationsregistry/index.html deleted file mode 100644 index e9d68ecf20..0000000000 --- a/files/es/web/api/domapplicationsregistry/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: DOMApplicationsRegistry -slug: Web/API/DOMApplicationsRegistry -tags: - - API - - Apps - - B2G - - Firefox OS - - No estandar - - Referencia -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry ---- -

{{ ApiRef("Apps") }}

- -

{{ non-standard_header() }}

- -

Provides support for installing, managing, and controlling Open Web apps in a browser. Currently implemented as {{ domxref('window.navigator.mozApps') }}.

- -

Propiedad

- -
-
{{domxref("DOMApplicationsRegistry.mgmt")}}
-
Un objeto mgmt que define funciones que le permiten a los tableros manejar y arrancar apps  a favor del usuario.
-
- -

Metodos

- -
-
{{ domxref("DOMApplicationsRegistry.checkInstalled()") }}
-
Verifica cuando una app se ha instalado tomando el manifiesto como su parametro.
-
{{ domxref("DOMApplicationsRegistry.install()") }}
-
Desencade la instalación de una app. Durante el proceso de instalación, la app es validada y se le pregunta al usuario si desea aprovar la instalación.
-
{{ domxref("DOMApplicationsRegistry.getSelf()") }}
-
Returna un objeto que contiene un {{ domxref('app') }} para la app.
-
{{ domxref("DOMApplicationsRegistry.getInstalled()") }}
-
Obtine una lista de todas las apps instaladas.
-
- -

Compatibilidad de navegadores

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Soporte basico{{ CompatUnknown() }}16.0{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Soporte basico{{ CompatUnknown() }}16.0{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
-
- -

 

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 ---- -
- {{ ApiRef() }} {{non-standard_header}}
-

Resumen

-

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 .

-

Si la aplicación estaba previamente instalada desde el mismo dominio, llamando install()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.

-

Syntax

-
var request = window.navigator.mozApps.install(url, [receipt1, …]);
-

Parameters

-
- Note: There is currently (May 2012) a bug with passing a relative path in the url parameter. See {{ Bug("745928") }}.
-
-
- url
-
- A string URL containing the location of the manifest 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 /).
-
- receipts
-
- (Optional) An array of one or more receipts. Example:
-
-
window.navigator.mozApps.install(url, ["receipt"])
-
-
- If receipts is omitted it is treated as null. For more information see Validating a receipt.
-
-

The install() function throws an exception if the required argument (url) is missing, or if unsupported arguments are present.

-

Returns

-

The install() function returns a {{ domxref("DOMRequest") }} object. The DOMRequest.result field contains an App object, which is a JavaScript object that describes the app that was just installed. Before the operation is finished, DOMRequest.result is null.

-

If the installation is not successful, DOMRequest.error contains a DOMError object, which has information about the error.

-

Example

-

An example that shows how to use install() with the DOMRequest.onsuccess and DOMRequest.onerror callback properties.

-
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);
-};
-
-

The onsuccess callback is called if the installation is successful. This means that the installation actions described here have occurred.

-

If the installation is not successful the onerror callback is called. On a failed installation, DOMRequest.error contains a DOMError object that has information about the error.

-

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 DOMRequest object operates. The function invocation will wait until the listeners are defined, and then the listeners will fire appropriately. The install() function also works by itself, without the .onsuccess and .onerror listeners.

-

Errors

-

When the installation is unsuccessful, one of the following errors can be returned in DOMRequest.error.

-
-
- DENIED
-
- The user cancelled the installation.
-
- INVALID_MANIFEST
-
- The manifest, while well-formed JSON, does not have some required field or is somehow invalid.
-
- MANIFEST_URL_ERROR
-
- Something other than an HTTP 200 status code was received, or some connection errors.
-
- MANIFEST_PARSE_ERROR
-
- Bad JSON in the manifest.
-
- NETWORK_ERROR
-
- Connection error.
-
- REINSTALL_FORBIDDEN
-
- Reinstalls of apps are forbidden.
-
- MULTIPLE_APPS_PER_ORIGIN_FORBIDDEN
-
- Installable apps have a "single app per origin" security policy; basically, you can't host more than one installable app per origin.
-
- - diff --git a/files/es/web/api/domapplicationsregistry/installpackage/index.html b/files/es/web/api/domapplicationsregistry/installpackage/index.html deleted file mode 100644 index c269240c60..0000000000 --- a/files/es/web/api/domapplicationsregistry/installpackage/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Apps.installPackage -slug: Web/API/DOMApplicationsRegistry/installPackage -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/installPackage ---- -
- {{ApiRef}} {{non-standard_header}}
-

Resumen

-

Instala una aplicación empaquetada.

-
- Solo disponible en Firefox OS.
-

Sintaxis

-
installPackage: function(aURL[, aParams])
-

Parametros

- -

Resultados

-
-
- aURL
-
- El URL del paquete de aplicación a instalar. Esta debe ser una URL completa y absoluta.
-
- aParams
-
- Opcionalmente, un objeto con información adicional:
-
- DOMRequest
-
-

Véase también

- diff --git a/files/es/web/api/mozsocial/closepanel/index.html b/files/es/web/api/mozsocial/closepanel/index.html deleted file mode 100644 index 1b2305967f..0000000000 --- a/files/es/web/api/mozsocial/closepanel/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: MozSocial.closePanel -slug: Web/API/MozSocial/closePanel -tags: - - Social -translation_of: Archive/Social_API/MozSocial/closePanel ---- -

{{ ApiRef() }}

-

{{non-standard_header()}}

-

{{fx_minversion_header("17.0")}}

-

Resumen

-

Cierra el panel social que está actualmente abierto en el panel del proveedor de servicios sociales de nivel superior.

-

Sintaxis

-
MozSocial.closePanel();
-
-

Parametros

-

Ninguno.

-

Especificación

-

No es parte de ninguna especificación.

diff --git a/files/es/web/api/mozsocial/getattention/index.html b/files/es/web/api/mozsocial/getattention/index.html deleted file mode 100644 index e362749b56..0000000000 --- a/files/es/web/api/mozsocial/getattention/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: MozSocial.getAttention -slug: Web/API/MozSocial/getAttention -tags: - - Social -translation_of: Archive/Social_API/MozSocial/getAttention ---- -

{{ ApiRef() }}

-

{{non-standard_header()}}

-

{{fx_minversion_header("17.0")}}

-

Resumen

-

Ejecuta algunas acciones, posiblemente específicas de la plataforma, diseñadas para obtener la atención del usuario. Esto puede involucrar la reproducción de un efecto de sonido, parpadeo en la pantalla, o mostrando alguna otra forma de efecto.

-

Sintaxis

-
MozSocial.getAttention();
-
-

Parámetros

-

Ninguno.

-

Especificación

-

No es parte de ninguna especificación.

diff --git a/files/es/web/api/mozsocial/getworker/index.html b/files/es/web/api/mozsocial/getworker/index.html deleted file mode 100644 index e32cc7b240..0000000000 --- a/files/es/web/api/mozsocial/getworker/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: MozSocial.getWorker -slug: Web/API/MozSocial/getWorker -translation_of: Archive/Social_API/MozSocial/getWorker ---- -

{{ ApiRef() }}

-

{{non-standard_header()}}

-

{{fx_minversion_header("17.0")}}

-

Resumen

-

Devuelve una referencia al  worker del servicio de contenidos de redes sociales. Una vez obtenido, puedes llamar a su método postMessage() para comunicarte con él. Puedes usar uno de los  mensajes estándares para redes sociales, o mensajes específicos de ese servicio.

-

Sintaxis

-
var socialWorker = MozSocial.getWorker();
-
-

Parámetros

-

Ninguno.

-

Valor devuelto

-

Una referencia al worker del servicio.

-

Especificación

-

No forma parte de ninguna especificación.

diff --git a/files/es/web/api/mozsocial/index.html b/files/es/web/api/mozsocial/index.html deleted file mode 100644 index a2f559a9df..0000000000 --- a/files/es/web/api/mozsocial/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: MozSocial -slug: Web/API/MozSocial -tags: - - API -translation_of: Archive/Social_API/MozSocial ---- -
{{ ApiRef("Social API") }} {{non-standard_header}}{{fx_minversion_header("17.0")}}
- -

The MozSocial object, returned by the navigator.mozSocial property, is available within the social media provider's panel to provide functionality it may need.

- -
-

Note: Although Mozilla hopes to submit this API for standardization eventually, it has not yet done so.

-
- -

Properties

- -
-
{{domxref("MozSocial.isVisible")}}
-
Returns a Boolean value; the result is true if the content is visible, otherwise it's false.
-
- -

Methods

- -
-
{{domxref("MozSocial.closePanel()")}}
-
Closes the currently open flyout panel.
-
{{domxref("MozSocial.getAttention()")}}
-
Performs some action designed to get the user's attention; the exact behavior may vary from platform to platform. This might display a visual effect, play an audible notification, flash the screen, or use some other technique.
-
{{domxref("MozSocial.getWorker()")}}
-
Returns a reference to the service worker; once content has this reference, it can call worker.port.postMessage() method to communicate with the service.
-
{{domxref("MozSocial.openChatWindow()")}}
-
Opens a chat window that is anchored to the bottom of the browser window. Each chat window is expected to be a singular chat, but functionality may vary by provider.
-
{{domxref("MozSocial.openPanel()")}}
-
Opens a flyout panel attached to the sidebar at a given vertical offset. This might be, for example, used to display the actual conversation corresponding to a notification in the sidebar.
-
{{domxref("MozSocial.share()")}}
-
Initiates a share action via the SocialAPI Share panel.  One argument is passed, an object containing "url", "title", "description", "source" and "image".
-
- -

See also

- - diff --git a/files/es/web/api/mozsocial/isvisible/index.html b/files/es/web/api/mozsocial/isvisible/index.html deleted file mode 100644 index 7bc90e47da..0000000000 --- a/files/es/web/api/mozsocial/isvisible/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: MozSocial.isVisible -slug: Web/API/MozSocial/isVisible -tags: - - Social -translation_of: Archive/Social_API/MozSocial/isVisible ---- -

{{non-standard_header()}}

-

{{fx_minversion_header("17.0")}}

-

{{ ApiRef() }}

-

Resumen

-

Indica si la barra lateral del contenido del proveedor de social media está o no visible actualmente.

-

Sintaxis

-
var visible = navigator.MozSocial.isVisible
-
-

Al retornar, visible es true si la barra lateral es visible actualmente; de otro modo es false.

-

Especificación

-

No es parte de ninguna especificación.

-

Ver también

- diff --git a/files/es/web/api/mozsocial/openchatwindow/index.html b/files/es/web/api/mozsocial/openchatwindow/index.html deleted file mode 100644 index 26f6b97643..0000000000 --- a/files/es/web/api/mozsocial/openchatwindow/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: MozSocial.openChatWindow -slug: Web/API/MozSocial/openChatWindow -translation_of: Archive/Social_API/MozSocial/openChatWindow ---- -

{{ ApiRef() }}

-

{{non-standard_header()}}

-

{{fx_minversion_header("17.0")}}

-

Resumen

-

Abre una ventana de chat, anclada en la parte inferior de la ventana del navegador. Cada ventana de chat suele ser un one-on-one chat, pero esta funcionalidad puede variar dependiendo del proveedor.

-

Sintaxis

-
MozSocial.openChatWindow(toUrl, callback);
-
-

Parametros

-
-
- toUrl
-
- URL a la que se abre la conexión de chat.
-
- callback
-
- Un objeto para recibir notificaciones de devolución de llamada en la conexión. La devolución de llamada recibe como entrada una referencia a la ventana de chat. Vease Implementing chat functionality para más detalles.
-
-

Especificaciones

-

No es parte de ninguna especificación.

diff --git a/files/es/web/api/mozsocial/openpanel/index.html b/files/es/web/api/mozsocial/openpanel/index.html deleted file mode 100644 index 9ea96cd5bd..0000000000 --- a/files/es/web/api/mozsocial/openpanel/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: MozSocial.openPanel -slug: Web/API/MozSocial/openPanel -translation_of: Archive/Social_API/MozSocial/openPanel ---- -

{{ ApiRef() }}

-

{{non-standard_header()}}

-

{{fx_minversion_header("17.0")}}

-

Resumen

-

Abre un panel desplegable sujeto a la barra lateral del proveedor de medios sociales con una distancia vertical dada.

-

Sintaxis

-
MozSocial.openPanel(toUrl, offset, callback);
-
-

Parámetros

-
-
- toUrl
-
- La URL al contenido a presentar en el panel.
-
- offset
-
- La distancia vertical, en pixeles, a la cual posicionar el panel desplegable.
-
- callback
-
- Un objeto para recibir notificaciones devueltas por la conexión. La llamada de vuelta recibe como entrada una referencia al panel desplegable. <<<OCUPA ENLACE A DETALLES>>>
-
-

Especificación

-

No es parte de ninguna especificación.

diff --git a/files/es/web/api/navigator/id/index.html b/files/es/web/api/navigator/id/index.html deleted file mode 100644 index 707d9a6255..0000000000 --- a/files/es/web/api/navigator/id/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: navigator.id -slug: Web/API/Navigator/id -translation_of: Archive/Navigator-id ---- -
{{ ApiRef("Persona") }}
- -

Summary

- -

The BrowserID protocol defines a new id property on the {{ domxref ("window.navigator")}} object, through which it exposes the BrowserID API, that is the {{domxref("IdentityManager")}} intreface. This API has gone through several significant revisions. Each generation is listed separately below.

- -

Syntax

- -
var id = navigator.id
- -

 

diff --git a/files/es/web/api/navigator/mozsocial/index.html b/files/es/web/api/navigator/mozsocial/index.html deleted file mode 100644 index cf5dd808f8..0000000000 --- a/files/es/web/api/navigator/mozsocial/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: navigator.mozSocial -slug: Web/API/Navigator/mozSocial -translation_of: Archive/mozSocial ---- -

{{non-standard_header()}}

-

{{fx_minversion_header("17.0")}}

-

{{ ApiRef() }}

-

El objeto MozSocial , regresado por la propiedad navigator.mozSocial , esta disponible dentro del tablero del proveedor de medios de comunicación para proporcionar la funcionalidad que pueda necesitar.

-
-

Nota: Aunque mozilla espera enviar eventualmente este API para su  estandarización, aun no se ha hecho.

-
-

Atributos

-
-
- {{domxref("MozSocial.isVisible")}}
-
- Regresa un valor Booleano; el resultado es true si el contenido es visible, de otra manera es false.
-
-

Métodos

-
-
- {{domxref("MozSocial.closePanel()")}}
-
- Cierra el tablero flotante abierto actualmente.
-
- {{domxref("MozSocial.getAttention()")}}
-
- Realiza algunas acciones diseñadas para obtener la atención del usuario; el mismo comportamiento puede variar de plataforma a plataforma. Esto puede mostrar un efecto visual, reproducir una notificación audible, parpadear la pantalla, o utilizar alguna otra técnica.
-
- {{ domxref("MozSocial.getWorker()") }}
-
- Regresa una referencia al trabajador de servicios; una vez el  contenido tiene esta referencia, puede llamar a su método postMessage() para comunicarse con el servicio.
-
- {{domxref("MozSocial.openChatWindow()")}}
-
- Abre una ventana de chat que es anclada al pie de la ventana del navegador. Se espera que cada ventana de chat sea un chat singular, pero su funcionalidad va a variar dependiento del proveedor.
-
- {{domxref("MozSocial.openPanel()")}}
-
- Abre un tablero flotante adjunto a la barra lateral en una vertical dada para compensar. Esto puede ser, por ejemplo, utilizado para mostrar la conversación actual correspondiente a una notificación en la barra lateral.
-
-  
-
- Vease Tambien
-
- Social API
-
diff --git a/files/es/web/api/simple_push_api/index.html b/files/es/web/api/simple_push_api/index.html deleted file mode 100644 index d3d4dd4d1a..0000000000 --- a/files/es/web/api/simple_push_api/index.html +++ /dev/null @@ -1,235 +0,0 @@ ---- -title: Simple Push -slug: Web/API/Simple_Push_API -translation_of: Archive/B2G_OS/API/Simple_Push_API ---- -

{{ non-standard_header() }}

- -
-

Nota: Esta documentación cubre el mecanismo propietario Simple Push de Firefox OS; si usted está buscando la documentación sobre el W3C Push API, diríjase a Push API.

-
- -

El Simple Push API, también conocido como Push Notification API, provee a las aplicaciones la habilidad de ser despertadas para recibir notificaciones. Usted puede utilizar Simple Push como un mecanismo de sincronización, o incluso para traer datos desde servidores de terceros.

- -

Un "push" (empujón) no es más que un evento enviado a un servidor remoto. Así es como funciona: una aplicación usa el Simple Push API para solicitar una URL especial y única llamada endpoint (punto final). Esta solicitud viaja hacia un servidor existente mantenido por Mozilla especialmente para este proposito (este se denomina "push server"). Cuando la aplicación recibe el endpoint de vuelta desde el push server, la aplicación envía el endpoint a su propio servidor (su servidor de aplicación). El servidor de aplicación guarda este endpoint, luego cuando quiere despertar la aplicación, llama al endpoint con un número de versión, y el push server contacta a la aplicación con una notificación del número de versión. La aplicación puede hacer cualquier cosa al momento de recibir la notificación, incluso ignorarla.

- -

El Simple Push API extiende Window.navigator con una propiedad push que es un objeto {{domxref("PushManager")}}, e incluye algunos eventos nuevos que usted puede recibir para monitorear el estado del empuje.

- -

Ejemplo mostrando los conceptos básicos

- -

Existen varias formas de usar la Simple Push API. Este ejemplos cubren los conceptos básicos de como usarla. El ejemplo consta de los siguientes pasos generales. Consulte las siguientes secciones para obtener información completa sobre cada paso.

- -
    -
  1. Añadir configuración push al manifiesto de la aplicación
  2. -
  3. LLamar a PushManager.register para solicitar un endpoint
  4. -
  5. Enviar un endpoint a su servidor
  6. -
  7. Agregar a su aplicación controladores de mensajes para notificaciones push
  8. -
  9. Enviar una notificación desde su servidor utilizando el endpoint
  10. -
- -

1. Añadir configuración push al manifiesto de la aplicación

- -

Usted necesita cambiar dos cosas en el manifiesto de la aplicación para poder utilizar Simple Push:

- -
    -
  1. Campo messages - Añadir push y push-register a messages.
    - Esto le hace saber a la página de aplicación que recibirá cada uno de estos eventos (push y push-register). En este ejemplo, ambos van a la misma página: "/index.html", pero también pueden usar otras páginas. Observe a continuación para mayor información sobre cada uno de estos eventos.
  2. -
  3. Campo permissions - Añadir que su aplicación quiere recibir notificaciones push.
    - Es una buena idea proveer una descripción clara en este campo para que el usuario final entienda por qué usted necesita permisos de empuje ("push").
  4. -
- -
"messages": [
-   { "push": "/index.html"},
-   { "push-register": "/index.html"}
-],
-"permissions": {
-  "push": {
-    "description": "Required for being updated with new goals in soccer matches"
-  }
-}
- -

2. LLamar a PushManager.register() para solicitar un endpoint

- -

La aplicación necesita solicitar un endpoint llamando {{domxref("PushManager.register")}}. Usted debe decidir cuando este debe ser llamado. Usted podría llamarlo cuando el usuario ha iniciado sesión en el servicio, o cuando el usuario decide comenzar a ver un partido de fútbol, o en cualquier otro momento. El código a continuación es una forma de hacerlo.

- -
if (navigator.push) {
-  // Solicitar el endpoint. Esto usa PushManager.register().
-  var req = navigator.push.register();
-
-  req.onsuccess = function(e) {
-    var endpoint = req.result;
-      console.log("New endpoint: " + endpoint );
-      // En este punto, usted deberá usar algunos llamados para enviar el
-      // endpoint a su servidor. Por ejemplo:
-      /*
-      var post = XMLHTTPRequest();
-      post.open("POST", "https://your.server.here/registerEndpoint");
-      post.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-      post.send("endpoint=" + encodeURIComponents( endpoint ) );
-      */
-      // Obviamente usted querrá añadir controladores .onload y .onerror,
-      // añadir información de id del usuario, y cualquier otra cosa que podría
-      // necesitar para asocial el endpoint con el usuario.
-    }
-
-   req.onerror = function(e) {
-     console.error("Error getting a new endpoint: " + JSON.stringify(e));
-   }
-} else {
-  // push no se encuentra disponible en el DOM, así que haga algo diferente.
-}
- -

3. Enviar un endpoint a su servidor

- -

Una vez que la aplicación ha recibido un endpoint, esta necesita enviarla a su servidor de aplicación. Hay más de una forma de hacer esto. Por ejemplo usted puede enviarla por email, o enviarla a través de POST, PUT, o incluso GET. Nosotros recomendamos que almacene el endpoint con algunos datos de usuario desde la aplicación, tales como una cookie, un username, o lo que sea que usted utilice para identificar su par enpoint-user.

- -

Pero si usted está enviando a su servidor, nosotros recomendamos que siga estas buenas prácticas:

- - - -

4. Agregar a su aplicación controladores de mensajes para notificaciones push

- -

Una vez haya configurado su endpoint siguiendo los pasos anteriores, usted está listo para hacer que su aplicación comience a escuchar mensajes push y push-register utilizando los controladores de mensajes.

- -

Añadir un controlador de mensajes push

- -

El controlador de mensajes push puede encontrarse en su archivo index.html o en su script main.js, o incluso en un archivo específico push-message.html que contiene solamente el controlador de mensajes. Esto puede ser útil si un mensaje push es enviado y su aplicación se encuentra cerrada, porque cargará solamente una pequeña porción del código HTML/JavaScript, y usted puede decidir si la aplicación necesita estar completamente abierta o puede hacer algo en segundo plano. Donde sea que usted decida ubicar el controlador de mensajes push, asegurese de que el manifiesto apunte a la ubicación correcta (ver el primer paso anterior), de otro modo su aplicación podría no obtener actualizaciones. Aquí hay un ejemplo de un controlador de mensajes push:

- -
if (window.navigator.mozSetMessageHandler) {
-  window.navigator.mozSetMessageHandler('push', function(e) {
-    console.log('My endpoint is ' + e.pushEndpoint);
-    console.log('My new version is ' +  e.version);
-    // Recuerde que usted puede controlar aquí si tiene más de
-    // un pushEndpoint
-    if (e.pushEndpoint === emailEndpoint) {
-      emailHandler(e.version);
-    } else if (e.pushEndpoint === imEndpoint) {
-      imHandler(e.version);
-    }
-  });
-} else {
-  // Controlador No message
-}
- -

Añadir un controlador de mensajes push-register

- -
-

Nota: Asegurese de añadir este controlador y verificar que funciona. Si ustedes no registra de nuevo sus endpoints cuando este mensaje es recibido por su aplicación, la aplicación NO SERÁ CAPAZ de recibir nuevas notificaciones push.

-
- -

Un mensaje push-register será enviado a todas las aplicaciones cuando el dispositivo cambie su identificador interno (llamado el UAID o User Agent Identifier). Esto puede deberse a que el servidor push ha cambiado, o se ha caido y necesita recuperarse, o cualquier otra circunstancia. Si cualquiera de estas cosas llegara a ocurrir, ustedes DEBE registrar de nuevo todos sus endpoints, porque sus previos endpoints ya no serán válidos. Por lo tanto su aplicación necesita implementar un controlador de mensajes push-register. Observe el siguiente código de ejemplo.

- -
if (window.navigator.mozSetMessageHandler) {
-  window.navigator.mozSetMessageHandler('push-register', function(e) {
-    console.log('push-register received, I need to register my endpoint(s) again!');
-
-    var req = navigator.push.register();
-    req.onsuccess = function(e) {
-      var endpoint = req.result;
-      console.log("New endpoint: " + endpoint );
-      localStorage.endpoint = endpoint;
-    }
-
-    req.onerror = function(e) {
-      console.error("Error getting a new endpoint: " + JSON.stringify(e));
-    }
-  });
-} else {
-  // Controlador No message
-}
- -

5. Enviar una notificación desde su servidor utilizando el endpoint

- -

Una vez usted tiene el endpoint en su servidor, usted puede enviar una notificación simplemente enviando una petición HTTP PUT al endpoint con el cuerpo version=<version>. Por ejemplo, imagine un endpoint con la siguiente URL:

- -
https://updates.push.services.mozilla.com/update/abcdef01234567890abcdefabcdef01234567890abcdef
- -

y con la version 5:

- -
version=5
- -

Así es como la notificación se verá utilizando curl:

- -
curl -X PUT -d "version=5" https://updates.push.services.mozilla.com/update/abcdef01234567890abcdefabcdef01234567890abcdef
- -

Si el servidor push esta corriendo correctamente, usted recibirá una respuesta con un 200 Status (OK) y un {} como cuerpo. También podría recibir un 200 Status indicando que el mensaje fue aceptado, pero que pudo haber sido controlado por un sistema alternativo. Si no, una respuesta error HTTP valida con un JSON explicando el error será retornada.

- -
-

Por favor recuerde: Solo porque Simple Push ha aceptado el mensaje, esto no garantiza que el mensaje será entregado exitosamente a la aplicación. Muchos factores, desde un dispositivo desconectado a varios fallos de transmisión de datos, pueden ocacionar que no se entregue exitosamente una notificación. Nosotros hacemos nuestro mejor esfuerzo, pero a veces el universo tiene otros planes.

-
- -

Recuerde que el valor de version debe ser números enteros, e incrementales. Las aplicaciones no recibirán nuevas notificaciones si la versión en menor a aquella almacenada en el servidor y/o dispositivo. Las versiones pueden ser útiles para que la aplicación indique si existen eventos "perdidos" que realmente debería verificar. Usted también podriá simplemente usar el UTC (el número de segundos desde la media noche del 1 de enero de 1970, GMT) actual si el valor de la versión no es muy importante para usted.

- -

Anular el registro de un endpoint

- -

Una vez haya terminado de utilizar el endpoint y no desee recibir más notificaciones, le rogamos anular el registro del antiguo endpoint mediante {{domxref("PushManager.unregister")}}. Esto limpiará la cantidad de datos que el dispositivo envía al servidor push, y además disminuirá el consumo de batería al no enviar notificaciones de las aplicaciones que no las usen.

- -

Especificaciones

- -

{{page("/en-US/docs/Web/API/PushManager","Specifications")}}

- -

Conpatibilidad con navegadores

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte básico{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte básico{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -

Ver también

- - diff --git a/files/es/web/api/using_the_browser_api/index.html b/files/es/web/api/using_the_browser_api/index.html deleted file mode 100644 index 31fb24d2fb..0000000000 --- a/files/es/web/api/using_the_browser_api/index.html +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: Using the browser API -slug: Web/API/Using_the_Browser_API -translation_of: Mozilla/Gecko/Chrome/API/Browser_API/Using ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('privileged') }}

-

Summary

-

The HTML Browser API is an extension of the HTML {{HTMLElement("iframe")}} element that allows web apps to implement browsers or browser-like applications. This entails two major aspects:

- -

In addition to that, it's also possible to express the notion that the embedded content is an Open Web App. In that case the content is loaded within the appropriate app context (such as permissions).

-

Usage

-

An {{HTMLElement("iframe")}} is turned into a browser frame by setting the {{htmlattrxref("mozbrowser","iframe")}} attribute:

-
<iframe src="http://hostname.tld" mozbrowser>
-

In order to embed an Open Web App, the {{htmlattrxref("mozapp","iframe")}} attribute must also be supplied, with the path to the app's manifest:

-
<iframe src="http://hostname.tld" mozapp='http://path/to/manifest.webapp' mozbrowser>
-

At last the content of the {{HTMLElement("iframe")}} can be loaded in its own child process, separate to the page embedding this frame by using the {{htmlattrxref("remote","iframe")}} attribute.

-
<iframe src="http://hostname.tld" mozbrowser remote>
-
-

Warning: That last attribute is necessary for security reasons if you plan to load content from an untrusted/unknown origin. If you don't use it, you take the risk of your application being compromised by a malicious web site.

-
-

Permissions

-

Any application that wants to embed a browser frame must have the browser permission within its app manifest.

-
{
-  "permissions": {
-    "browser": {}
-  }
-}
-

Additionally, to embed an Open Web App, the app must have the embed-apps permission.

-
{
-  "permissions": {
-    "browser": {},
-    "embed-apps": {}
-  }
-}
-

Extra methods

-

To support the requirement of a browser {{HTMLElement("iframe")}}, Firefox OS extends the {{domxref("HTMLIFrameElement")}} DOM interface. Those new methods gives the {{HTMLElement("iframe")}} some super powers:

- -

Those methods allow navigating through the browsing history of the {{HTMLElement("iframe")}}. They are necessary to be able to implement back, forward, stop, and reload buttons.

- -

Performance methods

-

Those methods are used to manage the resources used by a browser {{HTMLElement("iframe")}}. This is especially useful for implementing tabbed browser application.

- -

Event methods

-

In order to manage the browser {{HTMLElement("iframe")}}'s content, many new events were added (see below). The following methods are used to deal with those events:

- -

Miscellaneous methods

-

Those methods are utilities, useful for apps that host a browser {{HTMLElement("iframe")}}.

- -

Events

-

In order to allow an application to manage the browser {{HTMLElement("iframe")}}, the application can listen for new events about what's happening within the browser {{HTMLElement("iframe")}}. The following new events can be listened for:

- -

Example

-

In this example we'll see how to implement a very basic browser app.

-

HTML

-

In the HTML we just add a URL bar, a "Go" and "Stop" button, and a browser {{HTMLElement("iframe")}}.

-
<header>
-  <input id="url">
-  <button id="go">Go</button>
-  <button id="stop">Stop</button>
-</header>
-
-<iframe src="about:blank" mozbrowser remote></iframe>
-
-

CSS

-

We switch between the go and stop button with a little css trick.

-
button:disabled {
-  display: none;
-}
-

JavaScript

-

Now we can add the required functionalities:

-
document.addEventListener("DOMContentLoaded", function () {
-  var url  = document.getElementById("url");
-  var go   = document.getElementById("go");
-  var stop = document.getElementById("stop");
-
-  var browser = document.getElementsByTagName("iframe")[0];
-
-  // This function is used to switch the Go and Stop button
-  // If the browser is loading content, "Go" is disabled and "Stop" is enabled
-  // Otherwise, "Go" is enabled and "Stop" is disabled
-  function uiLoading(isLoading) {
-      go.disabled =  isLoading;
-    stop.disabled = !isLoading;
-  }
-
-  go.addEventListener("touchend", function () {
-    browser.setAttribute("src", url.value);
-  });
-
-  stop.addEventListener("touchend", function () {
-    browser.stop();
-  });
-
-  // When the browser starts loading content, we switch the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowserloadstart', function () {
-    uiLoading(true);
-  });
-
-  // When the browser finishes loading content, we switch back the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowserloadend', function () {
-    uiLoading(false);
-  });
-
-  // In case of error, we also switch back the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowsererror', function (event) {
-    uiLoading(false);
-    alert("Loading error: " + event.detail);
-  });
-
-  // When a user follows a link, we make sure the new location is displayed in the address bar
-  browser.addEventListener('mozbrowserlocationchange', function (event) {
-    url.value = event.detail;
-  });
-});
-

See also

- -- cgit v1.2.3-54-g00ecf