Compare commits

..

1 Commits
0.5.4 ... 0.5.3

Author SHA1 Message Date
Steven Gill
7ae4130296 Updated version and RELEASENOTES.md for release 0.5.3 2014-10-03 16:10:13 -07:00
18 changed files with 185 additions and 386 deletions

View File

@@ -144,17 +144,3 @@
* Rename windows81 by windows8 in src directory
* Append Windows 8.1 platform configuration in plugin.xml
* Append Windows 8.1 proxy using x-ms-webview
### 0.5.4 (Dec 02, 2014)
* CB-7784 Exit event is not fired after `InAppBrowser` closing
* CB-7697 Add `locationBar` support to `InAppBrowser` **Windows** platform version
* CB-7690 `InAppBrowser` `loadstart/loadstop` events issues
* CB-7695 Fix `InAppBrowser` `injectScriptFile` for **Windows 8.1** / **Windows Phone 8.1**
* CB-7692 `InAppBrowser` local url opening bug in 8.1
* CB-7688 `Alert` is not supported in `InAppBrowser` on **Windows** platform
* CB-7977 Mention `deviceready` in plugin docs
* CB-7876 change test target to avoid undesired redirects
* CB-7712 remove references to `closebuttoncaption`
* CB-7850 clarify role of whitelist
* CB-7720 check if event is null since OK string from success callback was removed
* CB-7471 cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser

View File

@@ -77,10 +77,6 @@ Dieses Plugin bietet eine Web-Browser-Ansicht, die beim Aufruf angezeigt`window.
* **Presentationstyle**: Legen Sie auf `pagesheet` , `formsheet` oder `fullscreen` [Präsentationsstil][1] (standardmäßig fest`fullscreen`).
* **Transitionstyle**: Legen Sie auf `fliphorizontal` , `crossdissolve` oder `coververtical` [Übergangsstil][2] (standardmäßig fest`coververtical`).
* **Toolbarposition**: Legen Sie auf `top` oder `bottom` (Standard ist `bottom` ). Bewirkt, dass die Symbolleiste am oberen oder unteren Rand des Fensters sein.
Nur Windows:
* **versteckte**: Legen Sie auf `yes` um den Browser zu erstellen und laden Sie die Seite, aber nicht zeigen. Das Loadstop-Ereignis wird ausgelöst, wenn der Ladevorgang abgeschlossen ist. Weglassen oder auf `no` (Standard), den Browser öffnen und laden normalerweise zu haben.
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
@@ -92,7 +88,6 @@ Dieses Plugin bietet eine Web-Browser-Ansicht, die beim Aufruf angezeigt`window.
* BlackBerry 10
* Firefox OS
* iOS
* Windows 8 und 8.1
* Windows Phone 7 und 8
### Beispiel
@@ -177,10 +172,9 @@ Aus einem Aufruf zurückgegebenen Objekts`window.open`.
* Amazon Fire OS
* Android
* iOS
* Windows 8 und 8.1
* Windows Phone 7 und 8
### Kurzes Beispiel
### Kleines Beispiel
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) { alert(event.url); });
@@ -209,10 +203,9 @@ Aus einem Aufruf zurückgegebenen Objekts`window.open`.
* Amazon Fire OS
* Android
* iOS
* Windows 8 und 8.1
* Windows Phone 7 und 8
### Kurzes Beispiel
### Kleines Beispiel
var ref = window.open('http://apache.org', '_blank', 'location=yes');
var myCallback = function(event) { alert(event.url); }
@@ -235,10 +228,9 @@ Aus einem Aufruf zurückgegebenen Objekts`window.open`.
* Android
* Firefox OS
* iOS
* Windows 8 und 8.1
* Windows Phone 7 und 8
### Kurzes Beispiel
### Kleines Beispiel
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.close();
@@ -258,9 +250,8 @@ Aus einem Aufruf zurückgegebenen Objekts`window.open`.
* Amazon Fire OS
* Android
* iOS
* Windows 8 und 8.1
### Kurzes Beispiel
### Kleines Beispiel
var ref = window.open('http://apache.org', '_blank', 'hidden=yes');
// some time later...
@@ -290,9 +281,8 @@ Aus einem Aufruf zurückgegebenen Objekts`window.open`.
* Amazon Fire OS
* Android
* iOS
* Windows 8 und 8.1
### Kurzes Beispiel
### Kleines Beispiel
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {
@@ -322,7 +312,7 @@ Aus einem Aufruf zurückgegebenen Objekts`window.open`.
* Android
* iOS
### Kurzes Beispiel
### Kleines Beispiel
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {

View File

@@ -33,28 +33,28 @@ Este plugin proporciona una vista de navegador web que se muestra cuando se llam
## window.open
Se abre una dirección URL en una nueva instancia de `InAppBrowser`, la instancia actual del navegador o el navegador del sistema.
Se abre una dirección URL en una nueva `InAppBrowser` ejemplo, la instancia actual del navegador o el navegador del sistema.
var ref = window.open(url, target, options);
* **ref**: referencia a la `InAppBrowser` ventana. *(InAppBrowser)*
* **url**: el URL para cargar *(String)*. Llame a `encodeURI()` en esto si la URL contiene caracteres Unicode.
* **URL**: el URL para cargar *(String)*. Llame a `encodeURI()` en este si la URL contiene caracteres Unicode.
* **target**: el objetivo en el que se carga la URL, un parámetro opcional que se utiliza de forma predeterminada `_self`. *(String)*
* **objetivo**: el objetivo en el que se carga la URL, un parámetro opcional que por defecto es `_self` . *(String)*
* `_self`: se abre en el Cordova WebView si la URL está en la lista blanca, de lo contrario se abre en el `InAppBrowser`.
* `_blank`: abre en el `InAppBrowser`.
* `_system`: se abre en el navegador del sistema.
* `_self`: Se abre en el Cordova WebView si la URL está en la lista blanca, de lo contrario se abre en el`InAppBrowser`.
* `_blank`: Se abre en el`InAppBrowser`.
* `_system`: Se abre en el navegador web del sistema.
* **options**: opciones para el `InAppBrowser`. Opcional, contumaz a: `location=yes`. *(String)*
* **Opciones**: opciones para el `InAppBrowser` . Opcional, contumaz a: `location=yes` . *(String)*
La cadena de `options` no debe contener ningún espacio en blanco, y los pares de nombre y valor de cada característica deben estar separados por una coma. Los nombres de función son minúsculas. Todas las plataformas admiten el valor siguiente:
La `options` cadena no debe contener ningún espacio en blanco, y pares nombre/valor de cada característica deben estar separados por una coma. Los nombres de función son minúsculas. Todas las plataformas admiten el valor siguiente:
* **location**: se establece en `yes` o `no` para activar o desactivar la barra de ubicación de la `InAppBrowser`.
* **Ubicación**: A `yes` o `no` para activar el `InAppBrowser` de barra de ubicación activado o desactivado.
Sólo Android:
Android sólo:
* **closebuttoncaption**: establecer una cadena para usar como título del botón **hecho** .
* **oculta**: a `yes` para crear el navegador y cargar la página, pero no lo demuestra. El evento loadstop se desencadena cuando termine la carga. Omitir o a `no` (por defecto) para que el navegador abra y carga normalmente.
@@ -69,30 +69,25 @@ Se abre una dirección URL en una nueva instancia de `InAppBrowser`, la instanci
* **clearcache**: a `yes` para que el navegador es caché de galleta despejado antes de que se abra la nueva ventana
* **clearsessioncache**: a `yes` que la caché de cookie de sesión despejado antes de que se abra la nueva ventana
* **barra de herramientas**: a `yes` o `no` para activar la barra de herramientas on u off para el InAppBrowser (por defecto`yes`)
* **enableViewportScale**: Set a `yes` o `no` para evitar viewport escalar a través de una etiqueta meta (por defecto a `no`).
* **mediaPlaybackRequiresUserAction**: Set a `yes` o `no` para evitar HTML5 audio o vídeo de reproducción automática (por defecto a `no`).
* **allowInlineMediaPlayback**: A `yes` o `no` para permitir la reproducción de los medios de comunicación en línea HTML5, mostrando en la ventana del navegador en lugar de una interfaz específica del dispositivo de reproducción. Elemento `video` de HTML también debe incluir el atributo de `webkit-playsinline` (por defecto a `no`)
* **keyboardDisplayRequiresUserAction**: se establece en `yes` o `no` para abrir el teclado cuando elementos de formulario reciben el foco mediante llamada de JavaScript de `focus()` (por defecto a `yes`).
* **suppressesIncrementalRendering**: se establece en `yes` o `no` para esperar hasta que todos los nuevos contenidos de vista se recibieron antes de ser prestados (por defecto a `no`).
* **presentationstyle**: se establece en `pagesheet`, `formsheet` o `fullscreen` para definir el [estilo de la presentación][1] (por defecto a `fullscreen`).
* **transitionstyle**: se establece en `fliphorizontal`, `crossdissolve` o `coververtical` para definir el [estilo de transición][2] (por defecto `coververtical`).
* **enableViewportScale**: A `yes` o `no` para evitar la vista escala a través de una etiqueta meta (por defecto`no`).
* **mediaPlaybackRequiresUserAction**: A `yes` o `no` para evitar HTML5 audio o vídeo de reproducción automática (por defecto`no`).
* **allowInlineMediaPlayback**: A `yes` o `no` para permitir la reproducción de los medios de comunicación en línea HTML5, mostrando en la ventana del navegador en lugar de una interfaz específica del dispositivo de reproducción. El código de HTML `video` elemento también debe incluir la `webkit-playsinline` atributo (por defecto`no`)
* **keyboardDisplayRequiresUserAction**: A `yes` o `no` para abrir el teclado cuando elementos de formulario reciben el foco mediante JavaScript `focus()` llamada (por defecto`yes`).
* **suppressesIncrementalRendering**: A `yes` o `no` que esperar a que todo el contenido nuevo vista es recibido antes de ser prestados (por defecto`no`).
* **presentationstyle**: A `pagesheet` , `formsheet` o `fullscreen` para establecer el [estilo de la presentación][1] (por defecto`fullscreen`).
* **transitionstyle**: A `fliphorizontal` , `crossdissolve` o `coververtical` para establecer el [estilo de transición][2] (por defecto`coververtical`).
* **toolbarposition**: A `top` o `bottom` (valor por defecto es `bottom` ). Hace que la barra de herramientas en la parte superior o inferior de la ventana.
Sólo Windows:
* **oculta**: a `yes` para crear el navegador y cargar la página, pero no lo demuestra. El evento loadstop se desencadena cuando termine la carga. Omitir o a `no` (por defecto) para que el navegador abra y carga normalmente.
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
### Plataformas soportadas
* Amazon fire OS
* Amazon fuego OS
* Android
* BlackBerry 10
* Firefox OS
* iOS
* Windows 8 y 8.1
* Windows Phone 7 y 8
### Ejemplo
@@ -133,7 +128,7 @@ Como plugin no cumplir cualquier diseño es necesario añadir algunas reglas CSS
## InAppBrowser
El objeto devuelto desde una llamada a `window.open`.
El objeto devuelto desde una llamada a`window.open`.
### Métodos
@@ -146,38 +141,37 @@ El objeto devuelto desde una llamada a `window.open`.
## addEventListener
> Añade un detector para un evento de la `InAppBrowser`.
> Añade un detector para un evento de la`InAppBrowser`.
ref.addEventListener(eventname, callback);
* **ref**: referencia a la ventana de `InAppBrowser` *(InAppBrowser)*
* **ref**: referencia a la `InAppBrowser` ventana *(InAppBrowser)*
* **eventName**: el evento para escuchar *(String)*
* **loadstart**: evento se desencadena cuando el `InAppBrowser` comienza a cargar una dirección URL.
* **loadstop**: evento desencadena cuando los acabados `InAppBrowser` cargar una dirección URL.
* **loaderror**: evento se desencadena cuando el `InAppBrowser` encuentra un error al cargar una dirección URL.
* **exit**: evento se desencadena cuando se cierra la ventana de `InAppBrowser`.
* **loadstart**: evento desencadena cuando el `InAppBrowser` comienza a cargar una dirección URL.
* **loadstop**: evento desencadena cuando el `InAppBrowser` termina cargando una dirección URL.
* **loaderror**: evento desencadena cuando el `InAppBrowser` encuentra un error al cargar una dirección URL.
* **salida**: evento desencadena cuando el `InAppBrowser` se cierra la ventana.
* **callback**: la función que se ejecuta cuando se desencadene el evento. La función se pasa un objeto `InAppBrowserEvent` como un parámetro.
* **devolución de llamada**: la función que se ejecuta cuando se desencadene el evento. La función se pasa un `InAppBrowserEvent` objeto como parámetro.
### InAppBrowserEvent propiedades
* **type**: eventname, `loadstart`, `loadstop`, `loaderror` o `exit`. *(String)*
* **tipo**: eventname, ya sea `loadstart` , `loadstop` , `loaderror` , o `exit` . *(String)*
* **url**: la URL que se cargó. *(String)*
* **URL**: la URL que se cargó. *(String)*
* **code**: el código de error, sólo en el caso de `loaderror`. *(Número)*
* **código**: el código de error, sólo en el caso de `loaderror` . *(Número)*
* **message**: el mensaje de error, sólo en el caso de `loaderror`. *(String)*
* **mensaje**: el mensaje de error, sólo en el caso de `loaderror` . *(String)*
### Plataformas soportadas
* Amazon fire OS
* Amazon fuego OS
* Android
* iOS
* Windows 8 y 8.1
* Windows Phone 7 y 8
### Ejemplo rápido
@@ -188,28 +182,27 @@ El objeto devuelto desde una llamada a `window.open`.
## removeEventListener
> Elimina un detector para un evento de la `InAppBrowser`.
> Elimina un detector para un evento de la`InAppBrowser`.
ref.removeEventListener(eventname, callback);
* **ref**: referencia a la ventana de `InAppBrowser`. *(InAppBrowser)*
* **ref**: referencia a la `InAppBrowser` ventana. *(InAppBrowser)*
* **eventName**: dejar de escuchar para el evento. *(String)*
* **loadstart**: evento se desencadena cuando el `InAppBrowser` comienza a cargar una dirección URL.
* **loadstop**: evento desencadena cuando los acabados `InAppBrowser` cargar una dirección URL.
* **loaderror**: evento se desencadena cuando el `InAppBrowser` se encuentra con un error al cargar una dirección URL.
* **exit**: evento se desencadena cuando se cierra la ventana de `InAppBrowser`.
* **loadstart**: evento desencadena cuando el `InAppBrowser` comienza a cargar una dirección URL.
* **loadstop**: evento desencadena cuando el `InAppBrowser` termina cargando una dirección URL.
* **loaderror**: evento desencadena cuando el `InAppBrowser` se encuentra con un error al cargar una dirección URL.
* **salida**: evento desencadena cuando el `InAppBrowser` se cierra la ventana.
* **callback**: la función a ejecutar cuando se desencadene el evento. La función se pasa un objeto `InAppBrowserEvent`.
* **devolución de llamada**: la función a ejecutar cuando se desencadene el evento. La función se pasa un `InAppBrowserEvent` objeto.
### Plataformas soportadas
* Amazon fire OS
* Amazon fuego OS
* Android
* iOS
* Windows 8 y 8.1
* Windows Phone 7 y 8
### Ejemplo rápido
@@ -222,20 +215,19 @@ El objeto devuelto desde una llamada a `window.open`.
## close
> Cierra la ventana de `InAppBrowser`.
> Se cierra el `InAppBrowser` ventana.
ref.close();
Ref.Close();
* **ref**: referencia a la ventana de `InAppBrowser` *(InAppBrowser)*
* **ref**: referencia a la `InAppBrowser` ventana *(InAppBrowser)*
### Plataformas soportadas
* Amazon fire OS
* Amazon fuego OS
* Android
* Firefox OS
* iOS
* Windows 8 y 8.1
* Windows Phone 7 y 8
### Ejemplo rápido
@@ -248,17 +240,16 @@ El objeto devuelto desde una llamada a `window.open`.
> Muestra una ventana InAppBrowser que abrió sus puertas ocultada. Esto no tiene efecto si el InAppBrowser ya era visible.
ref.show();
Ref.Show();
* **ref**: referencia a la (ventana) InAppBrowser`InAppBrowser`)
### Plataformas soportadas
* Amazon fire OS
* Amazon fuego OS
* Android
* iOS
* Windows 8 y 8.1
### Ejemplo rápido
@@ -269,28 +260,27 @@ El objeto devuelto desde una llamada a `window.open`.
## executeScript
> Inyecta código JavaScript en la ventana de `InAppBrowser`
> Inyecta código JavaScript en la `InAppBrowser` ventana
ref.executeScript(details, callback);
* **ref**: referencia a la ventana de `InAppBrowser`. *(InAppBrowser)*
* **ref**: referencia a la `InAppBrowser` ventana. *(InAppBrowser)*
* **injectDetails**: detalles de la secuencia de comandos para ejecutar, o especificar un `file` o `code` clave. *(Objeto)*
* **file**: URL del script para inyectar.
* **code**: texto de la escritura para inyectar.
* **archivo**: URL de la secuencia de comandos para inyectar.
* **código**: texto de la escritura para inyectar.
* **devolución de llamada**: la función que se ejecuta después de inyecta el código JavaScript.
* Si el script inyectado es del tipo de `code`, la devolución de llamada se ejecuta con un solo parámetro, que es el valor devuelto del guión, envuelto en una `Array`. Para scripts multilíneas, este es el valor devuelto de la última declaración, o la última expresión evaluada.
* Si el script inyectado es de tipo `code` , la devolución de llamada se ejecuta con un solo parámetro, que es el valor devuelto por el guión, envuelto en un `Array` . Para los scripts de varias líneas, este es el valor devuelto de la última declaración, o la última expresión evaluada.
### Plataformas soportadas
* Amazon fire OS
* Amazon fuego OS
* Android
* iOS
* Windows 8 y 8.1
### Ejemplo rápido
@@ -302,23 +292,23 @@ El objeto devuelto desde una llamada a `window.open`.
## insertCSS
> Inyecta CSS en la ventana de `InAppBrowser`.
> Inyecta CSS en la `InAppBrowser` ventana.
ref.insertCSS(details, callback);
* **ref**: referencia a la ventana de `InAppBrowser` *(InAppBrowser)*
* **ref**: referencia a la `InAppBrowser` ventana *(InAppBrowser)*
* **injectDetails**: detalles de la secuencia de comandos para ejecutar, o especificar un `file` o `code` clave. *(Objeto)*
* **file**: URL de la hoja de estilos para inyectar.
* **code**: texto de la hoja de estilos para inyectar.
* **archivo**: URL de la hoja de estilos para inyectar.
* **código**: texto de la hoja de estilos para inyectar.
* **callback**: la función que se ejecuta después de inyectar el CSS.
* **devolución de llamada**: la función que se ejecuta después de inyectar el CSS.
### Plataformas soportadas
* Amazon fire OS
* Amazon fuego OS
* Android
* iOS

View File

@@ -57,7 +57,7 @@ Ouvre une URL dans une nouvelle `InAppBrowser` instance, l'instance de navigateu
Android uniquement :
* **closebuttoncaption**: affectez une chaîne à utiliser comme la **fait** légende du bouton.
* **caché**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
* **hidden**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
* **ClearCache**: la valeur `yes` pour que le navigateur du cache de cookie effacé, avant l'ouverture de la nouvelle fenêtre
* **clearsessioncache**: la valeur `yes` pour avoir le cache de cookie de session autorisé avant l'ouverture de la nouvelle fenêtre
@@ -65,7 +65,7 @@ Ouvre une URL dans une nouvelle `InAppBrowser` instance, l'instance de navigateu
* **closebuttoncaption**: affectez une chaîne à utiliser comme la **fait** légende du bouton. Notez que vous devrez localiser cette valeur vous-même.
* **disallowoverscroll**: la valeur `yes` ou `no` (valeur par défaut est `no` ). Active/désactive la propriété UIWebViewBounce.
* **caché**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
* **hidden**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
* **ClearCache**: la valeur `yes` pour que le navigateur du cache de cookie effacé, avant l'ouverture de la nouvelle fenêtre
* **clearsessioncache**: la valeur `yes` pour avoir le cache de cookie de session autorisé avant l'ouverture de la nouvelle fenêtre
* **barre d'outils**: la valeur `yes` ou `no` pour activer la barre d'outils ou désactiver pour le InAppBrowser (par défaut,`yes`)
@@ -80,7 +80,7 @@ Ouvre une URL dans une nouvelle `InAppBrowser` instance, l'instance de navigateu
Windows uniquement :
* **caché**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
* **hidden**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle

View File

@@ -23,23 +23,8 @@ This plugin provides a web browser view that displays when calling `window.open(
var ref = window.open('http://apache.org', '_blank', 'location=yes');
The InAppBrowser window behaves like a standard web browser,
and can't access Cordova APIs. For this reason, the InAppBrowser is recommended
if you need to load third-party (untrusted) content, instead of loading that
into the main Cordova webview. The InAppBrowser is not subject to the
whitelist, nor is opening links in the system browser.
The InAppBrowser provides by default its own GUI controls for the user (back,
forward, done).
This plugin hooks `window.open`.
Although `window.open` is in the global scope, InAppBrowser is not available until after the `deviceready` event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("window.open works well");
}
__NOTE__: The InAppBrowser window behaves like a standard web browser,
and can't access Cordova APIs.
## Installation
@@ -70,6 +55,7 @@ instance, or the system browser.
Android only:
- __closebuttoncaption__: set to a string to use as the __Done__ button's caption.
- __hidden__: set to `yes` to create the browser and load the page, but not show it. The loadstop event fires when loading is complete. Omit or set to `no` (default) to have the browser open and load normally.
- __clearcache__: set to `yes` to have the browser's cookie cache cleared before the new window is opened
- __clearsessioncache__: set to `yes` to have the session cookie cache cleared before the new window is opened
@@ -112,7 +98,7 @@ instance, or the system browser.
### Firefox OS Quirks
As plugin doesn't enforce any design there is a need to add some CSS rules if
As plugin doesn't enforce any design there is a need to add some CSS rules if
opened with `target='_blank'`. The rules might look like these
``` css

View File

@@ -77,10 +77,6 @@ Apre un URL in una nuova `InAppBrowser` istanza, l'istanza corrente del browser
* **presentationstyle**: impostare su `pagesheet` , `formsheet` o `fullscreen` per impostare lo [stile di presentazione][1] (default`fullscreen`).
* **transitionstyle**: impostare su `fliphorizontal` , `crossdissolve` o `coververtical` per impostare lo [stile di transizione][2] (default`coververtical`).
* **toolbarposition**: impostare su `top` o `bottom` (default è `bottom` ). Provoca la barra degli strumenti sia nella parte superiore o inferiore della finestra.
Solo per Windows:
* **nascosti**: impostare su `yes` per creare il browser e caricare la pagina, ma non mostrarlo. L'evento loadstop viene generato quando il caricamento è completato. Omettere o impostata su `no` (impostazione predefinita) per avere il browser aperto e caricare normalmente.
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
@@ -92,7 +88,6 @@ Apre un URL in una nuova `InAppBrowser` istanza, l'istanza corrente del browser
* BlackBerry 10
* Firefox OS
* iOS
* Windows 8 e 8.1
* Windows Phone 7 e 8
### Esempio
@@ -177,7 +172,6 @@ L'oggetto restituito da una chiamata a`window.open`.
* Amazon fuoco OS
* Android
* iOS
* Windows 8 e 8.1
* Windows Phone 7 e 8
### Esempio rapido
@@ -209,7 +203,6 @@ L'oggetto restituito da una chiamata a`window.open`.
* Amazon fuoco OS
* Android
* iOS
* Windows 8 e 8.1
* Windows Phone 7 e 8
### Esempio rapido
@@ -235,7 +228,6 @@ L'oggetto restituito da una chiamata a`window.open`.
* Android
* Firefox OS
* iOS
* Windows 8 e 8.1
* Windows Phone 7 e 8
### Esempio rapido
@@ -258,7 +250,6 @@ L'oggetto restituito da una chiamata a`window.open`.
* Amazon fuoco OS
* Android
* iOS
* Windows 8 e 8.1
### Esempio rapido
@@ -290,7 +281,6 @@ L'oggetto restituito da una chiamata a`window.open`.
* Amazon fuoco OS
* Android
* iOS
* Windows 8 e 8.1
### Esempio rapido

View File

@@ -77,10 +77,6 @@
* **presentationstyle** に設定されている `pagesheet``formsheet` または `fullscreen` (デフォルトでは、[プレゼンテーション スタイル][1]を設定するには`fullscreen`).
* **transitionstyle** に設定されている `fliphorizontal``crossdissolve` または `coververtical` (デフォルトでは、[トランジションのスタイル][2]を設定するには`coververtical`).
* **toolbarposition** に設定されている `top` または `bottom` (既定値は `bottom` )。上部またはウィンドウの下部にツールバーが発生します。
Windows のみ:
* **非表示**: 設定 `yes` ブラウザーを作成して、ページの読み込みが表示されません。 Loadstop イベントは、読み込みが完了すると発生します。 省略するか設定 `no` (既定値) を開くし、通常読み込みブラウザーを持っています。
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
@@ -92,7 +88,6 @@
* ブラックベリー 10
* Firefox の OS
* iOS
* Windows 8 および 8.1
* Windows Phone 7 と 8
### 例
@@ -177,7 +172,6 @@
* アマゾン火 OS
* アンドロイド
* iOS
* Windows 8 および 8.1
* Windows Phone 7 と 8
### 簡単な例
@@ -209,7 +203,6 @@
* アマゾン火 OS
* アンドロイド
* iOS
* Windows 8 および 8.1
* Windows Phone 7 と 8
### 簡単な例
@@ -235,7 +228,6 @@
* アンドロイド
* Firefox の OS
* iOS
* Windows 8 および 8.1
* Windows Phone 7 と 8
### 簡単な例
@@ -258,7 +250,6 @@
* アマゾン火 OS
* アンドロイド
* iOS
* Windows 8 および 8.1
### 簡単な例
@@ -290,7 +281,6 @@
* アマゾン火 OS
* アンドロイド
* iOS
* Windows 8 および 8.1
### 簡単な例

View File

@@ -77,10 +77,6 @@
* **presentationstyle**: 설정 `pagesheet` , `formsheet` 또는 `fullscreen` [프레 젠 테이 션 스타일][1] (기본값을 설정 하려면`fullscreen`).
* **transitionstyle**: 설정 `fliphorizontal` , `crossdissolve` 또는 `coververtical` [전환 스타일][2] (기본값을 설정 하려면`coververtical`).
* **toolbarposition**: 설정 `top` 또는 `bottom` (기본값은 `bottom` ). 위쪽 또는 아래쪽 창에 도구 모음을 발생 합니다.
Windows에만 해당:
* **숨겨진**: 설정 `yes` 브라우저를 만들 페이지를 로드 하면, 하지만 그것을 보여주지. Loadstop 이벤트는 로드가 완료 되 면 발생 합니다. 생략 하거나 설정 `no` (기본값) 브라우저 열고 정상적으로 로드 해야 합니다.
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
@@ -92,7 +88,6 @@
* 블랙베리 10
* Firefox 운영 체제
* iOS
* 윈도우 8과 8.1
* Windows Phone 7과 8
### 예를 들어
@@ -177,7 +172,6 @@
* 아마존 화재 운영 체제
* 안 드 로이드
* iOS
* 윈도우 8과 8.1
* Windows Phone 7과 8
### 빠른 예제
@@ -209,7 +203,6 @@
* 아마존 화재 운영 체제
* 안 드 로이드
* iOS
* 윈도우 8과 8.1
* Windows Phone 7과 8
### 빠른 예제
@@ -235,7 +228,6 @@
* 안 드 로이드
* Firefox 운영 체제
* iOS
* 윈도우 8과 8.1
* Windows Phone 7과 8
### 빠른 예제
@@ -258,7 +250,6 @@
* 아마존 화재 운영 체제
* 안 드 로이드
* iOS
* 윈도우 8과 8.1
### 빠른 예제
@@ -290,7 +281,6 @@
* 아마존 화재 운영 체제
* 안 드 로이드
* iOS
* 윈도우 8과 8.1
### 빠른 예제

View File

@@ -26,7 +26,7 @@ Plugin daje widok przeglądarki sieci web, które są wyświetlane podczas wywo
**Uwaga**: The InAppBrowser okno zachowuje się jak standardowe przeglądarki, a nie ma dostępu do API Cordova.
## Instalacja
## Instalacji
cordova plugin add org.apache.cordova.inappbrowser
@@ -77,22 +77,17 @@ Otwiera URL w nowym `InAppBrowser` wystąpienie, bieżące wystąpienie przeglą
* **presentationstyle**: zestaw `pagesheet` , `formsheet` lub `fullscreen` Aby ustawić [styl prezentacji][1] (domyślnie`fullscreen`).
* **transitionstyle**: zestaw `fliphorizontal` , `crossdissolve` lub `coververtical` Aby ustawić [styl przejścia][2] (domyślnie`coververtical`).
* **toolbarposition**: zestaw `top` lub `bottom` (domyślnie `bottom` ). Powoduje, że pasek ma być na górze lub na dole okna.
Windows tylko:
* **ukryte**: zestaw `yes` do stworzenia przeglądarki i ładowania strony, ale nie pokazuje go. Loadstop zdarzenie fires po zakończeniu ładowania. Pominąć lub zestaw `no` (domyślnie) do przeglądarki otworzyć i załadować normalnie.
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
### Obsługiwane platformy
* Amazon Fire OS
* Amazon ogień OS
* Android
* BlackBerry 10
* Jeżyna 10
* Firefox OS
* iOS
* Windows 8 i 8.1
* Windows Phone 7 i 8
### Przykład
@@ -174,10 +169,9 @@ Obiekt zwrócony z wywołania`window.open`.
### Obsługiwane platformy
* Amazon Fire OS
* Amazon ogień OS
* Android
* iOS
* Windows 8 i 8.1
* Windows Phone 7 i 8
### Szybki przykład
@@ -206,10 +200,9 @@ Obiekt zwrócony z wywołania`window.open`.
### Obsługiwane platformy
* Amazon Fire OS
* Amazon ogień OS
* Android
* iOS
* Windows 8 i 8.1
* Windows Phone 7 i 8
### Szybki przykład
@@ -231,11 +224,10 @@ Obiekt zwrócony z wywołania`window.open`.
### Obsługiwane platformy
* Amazon Fire OS
* Amazon ogień OS
* Android
* Firefox OS
* iOS
* Windows 8 i 8.1
* Windows Phone 7 i 8
### Szybki przykład
@@ -255,10 +247,9 @@ Obiekt zwrócony z wywołania`window.open`.
### Obsługiwane platformy
* Amazon Fire OS
* Amazon ogień OS
* Android
* iOS
* Windows 8 i 8.1
### Szybki przykład
@@ -287,10 +278,9 @@ Obiekt zwrócony z wywołania`window.open`.
### Obsługiwane platformy
* Amazon Fire OS
* Amazon ogień OS
* Android
* iOS
* Windows 8 i 8.1
### Szybki przykład
@@ -318,7 +308,7 @@ Obiekt zwrócony z wywołania`window.open`.
### Obsługiwane platformy
* Amazon Fire OS
* Amazon ogień OS
* Android
* iOS

View File

@@ -77,22 +77,17 @@
* **presentationstyle**: набор `pagesheet` , `formsheet` или `fullscreen` чтобы задать [стиль презентации][1] (по умолчанию`fullscreen`).
* **transitionstyle**: набор `fliphorizontal` , `crossdissolve` или `coververtical` чтобы задать [стиль перехода][2] (по умолчанию`coververtical`).
* **toolbarposition**: значение `top` или `bottom` (по умолчанию `bottom` ). Вызывает панели инструментов, чтобы быть в верхней или нижней части окна.
Windows только:
* **скрытые**: значение `yes` для создания браузера и загрузки страницы, но не показать его. Событие loadstop возникает, когда загрузка завершена. Опустить или набор `no` (по умолчанию), чтобы браузер открыть и загрузить нормально.
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
### Поддерживаемые платформы
* Amazon Fire OS
* Amazon Fire ОС
* Android
* BlackBerry 10
* Firefox OS
* iOS
* Windows 8 и 8.1
* Windows Phone 7 и 8
### Пример
@@ -101,7 +96,7 @@
var ref2 = window.open(encodeURI('http://ja.m.wikipedia.org/wiki/ハングル'), '_blank', 'location=yes');
### Особенности Firefox OS
### Firefox OS причуды
Как плагин не применять любой дизайн есть необходимость добавить некоторые правила CSS, если открыт с `target='_blank'` . Правила может выглядеть как эти
@@ -131,7 +126,7 @@
}
## Внутренний браузер
## InAppBrowser
Объект, возвращаемый из вызова`window.open`.
@@ -174,13 +169,12 @@
### Поддерживаемые платформы
* Amazon Fire OS
* Amazon Fire ОС
* Android
* iOS
* Windows 8 и 8.1
* Windows Phone 7 и 8
### Краткий пример
### Быстрый пример
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) { alert(event.url); });
@@ -206,13 +200,12 @@
### Поддерживаемые платформы
* Amazon Fire OS
* Amazon Fire ОС
* Android
* iOS
* Windows 8 и 8.1
* Windows Phone 7 и 8
### Краткий пример
### Быстрый пример
var ref = window.open('http://apache.org', '_blank', 'location=yes');
var myCallback = function(event) { alert(event.url); }
@@ -231,14 +224,13 @@
### Поддерживаемые платформы
* Amazon Fire OS
* Amazon Fire ОС
* Android
* Firefox OS
* iOS
* Windows 8 и 8.1
* Windows Phone 7 и 8
### Краткий пример
### Быстрый пример
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.close();
@@ -255,12 +247,11 @@
### Поддерживаемые платформы
* Amazon Fire OS
* Amazon Fire ОС
* Android
* iOS
* Windows 8 и 8.1
### Краткий пример
### Быстрый пример
var ref = window.open('http://apache.org', '_blank', 'hidden=yes');
// some time later...
@@ -287,12 +278,11 @@
### Поддерживаемые платформы
* Amazon Fire OS
* Amazon Fire ОС
* Android
* iOS
* Windows 8 и 8.1
### Краткий пример
### Быстрый пример
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {
@@ -318,11 +308,11 @@
### Поддерживаемые платформы
* Amazon Fire OS
* Amazon Fire ОС
* Android
* iOS
### Краткий пример
### Быстрый пример
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {

View File

@@ -77,10 +77,6 @@
* **presentationstyle** 將設置為 `pagesheet` `formsheet``fullscreen` 來設置[演示文稿樣式][1](預設為`fullscreen`).
* **transitionstyle** 將設置為 `fliphorizontal` `crossdissolve``coververtical` 設置[過渡樣式][2](預設為`coververtical`).
* **toolbarposition** 將設置為 `top``bottom` (預設值是 `bottom` )。使工具列,則在頂部或底部的視窗。
僅限 Windows
* **隱藏** 將設置為 `yes` ,創建瀏覽器並載入頁面,但不是顯示它。 載入完成時,將觸發 loadstop 事件。 省略或被設置為 `no` (預設值),有的瀏覽器打開,以正常方式載入。
[1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
[2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
@@ -92,7 +88,6 @@
* 黑莓 10
* 火狐瀏覽器的作業系統
* iOS
* Windows 8 和 8.1
* Windows Phone 7 和 8
### 示例
@@ -177,7 +172,6 @@
* 亞馬遜火 OS
* Android 系統
* iOS
* Windows 8 和 8.1
* Windows Phone 7 和 8
### 快速的示例
@@ -209,7 +203,6 @@
* 亞馬遜火 OS
* Android 系統
* iOS
* Windows 8 和 8.1
* Windows Phone 7 和 8
### 快速的示例
@@ -235,7 +228,6 @@
* Android 系統
* 火狐瀏覽器的作業系統
* iOS
* Windows 8 和 8.1
* Windows Phone 7 和 8
### 快速的示例
@@ -258,7 +250,6 @@
* 亞馬遜火 OS
* Android 系統
* iOS
* Windows 8 和 8.1
### 快速的示例
@@ -290,7 +281,6 @@
* 亞馬遜火 OS
* Android 系統
* iOS
* Windows 8 和 8.1
### 快速的示例

View File

@@ -20,7 +20,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="org.apache.cordova.inappbrowser"
version="0.5.4">
version="0.5.3">
<name>InAppBrowser</name>
<description>Cordova InAppBrowser Plugin</description>

View File

@@ -81,6 +81,7 @@ public class InAppBrowser extends CordovaPlugin {
private static final String LOAD_START_EVENT = "loadstart";
private static final String LOAD_STOP_EVENT = "loadstop";
private static final String LOAD_ERROR_EVENT = "loaderror";
private static final String CLOSE_BUTTON_CAPTION = "closebuttoncaption";
private static final String CLEAR_ALL_CACHE = "clearcache";
private static final String CLEAR_SESSION_CACHE = "clearsessioncache";
@@ -90,6 +91,7 @@ public class InAppBrowser extends CordovaPlugin {
private CallbackContext callbackContext;
private boolean showLocationBar = true;
private boolean openWindowHidden = false;
private String buttonLabel = "Done";
private boolean clearAllCache= false;
private boolean clearSessionCache=false;
@@ -124,24 +126,21 @@ public class InAppBrowser extends CordovaPlugin {
// load in webview
if (url.startsWith("file://") || url.startsWith("javascript:")
|| Config.isUrlWhiteListed(url)) {
Log.d(LOG_TAG, "loading in webview");
webView.loadUrl(url);
}
//Load the dialer
else if (url.startsWith(AmazonWebView.SCHEME_TEL))
{
try {
Log.d(LOG_TAG, "loading in dialer");
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(url));
cordova.getActivity().startActivity(intent);
cordova.getActivity().startActivity(intent);
} catch (android.content.ActivityNotFoundException e) {
LOG.e(LOG_TAG, "Error dialing " + url + ": " + e.toString());
}
}
// load in InAppBrowser
else {
Log.d(LOG_TAG, "loading in InAppBrowser");
result = showWebPage(url, features);
}
}
@@ -291,8 +290,12 @@ public class InAppBrowser extends CordovaPlugin {
option = new StringTokenizer(features.nextToken(), "=");
if (option.hasMoreElements()) {
String key = option.nextToken();
Boolean value = option.nextToken().equals("no") ? Boolean.FALSE : Boolean.TRUE;
map.put(key, value);
if (key.equalsIgnoreCase(CLOSE_BUTTON_CAPTION)) {
this.buttonLabel = option.nextToken();
} else {
Boolean value = option.nextToken().equals("no") ? Boolean.FALSE : Boolean.TRUE;
map.put(key, value);
}
}
}
return map;
@@ -471,7 +474,6 @@ public class InAppBrowser extends CordovaPlugin {
return value;
}
@SuppressLint("NewApi")
public void run() {
// Let's create the main dialog
dialog = new InAppBrowserDialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar);
@@ -507,6 +509,9 @@ public class InAppBrowser extends CordovaPlugin {
back.setLayoutParams(backLayoutParams);
back.setContentDescription("Back Button");
back.setId(2);
/*
back.setText("<");
*/
Resources activityRes = cordova.getActivity().getResources();
int backResId = activityRes.getIdentifier("ic_action_previous_item", "drawable", cordova.getActivity().getPackageName());
Drawable backIcon = activityRes.getDrawable(backResId);
@@ -532,6 +537,7 @@ public class InAppBrowser extends CordovaPlugin {
forward.setLayoutParams(forwardLayoutParams);
forward.setContentDescription("Forward Button");
forward.setId(3);
//forward.setText(">");
int fwdResId = activityRes.getIdentifier("ic_action_next_item", "drawable", cordova.getActivity().getPackageName());
Drawable fwdIcon = activityRes.getDrawable(fwdResId);
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN)
@@ -571,13 +577,14 @@ public class InAppBrowser extends CordovaPlugin {
}
});
// Close/Done button
// Close button
Button close = new Button(cordova.getActivity());
RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
close.setLayoutParams(closeLayoutParams);
forward.setContentDescription("Close Button");
close.setId(5);
//close.setText(buttonLabel);
int closeResId = activityRes.getIdentifier("ic_action_remove", "drawable", cordova.getActivity().getPackageName());
Drawable closeIcon = activityRes.getDrawable(closeResId);
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN)
@@ -662,7 +669,7 @@ public class InAppBrowser extends CordovaPlugin {
// the goal of openhidden is to load the url and not display it
// Show() needs to be called to cause the URL to be loaded
if(openWindowHidden) {
dialog.hide();
dialog.hide();
}
}
};
@@ -695,6 +702,8 @@ public class InAppBrowser extends CordovaPlugin {
}
}
}
/**
* The webview client receives notifications about appView
@@ -825,6 +834,7 @@ public class InAppBrowser extends CordovaPlugin {
} catch (JSONException ex) {
Log.d(LOG_TAG, "Should never happen");
}
}
}
}

View File

@@ -75,6 +75,7 @@ public class InAppBrowser extends CordovaPlugin {
private static final String LOAD_START_EVENT = "loadstart";
private static final String LOAD_STOP_EVENT = "loadstop";
private static final String LOAD_ERROR_EVENT = "loaderror";
private static final String CLOSE_BUTTON_CAPTION = "closebuttoncaption";
private static final String CLEAR_ALL_CACHE = "clearcache";
private static final String CLEAR_SESSION_CACHE = "clearsessioncache";
@@ -84,6 +85,7 @@ public class InAppBrowser extends CordovaPlugin {
private CallbackContext callbackContext;
private boolean showLocationBar = true;
private boolean openWindowHidden = false;
private String buttonLabel = "Done";
private boolean clearAllCache= false;
private boolean clearSessionCache=false;
@@ -285,8 +287,12 @@ public class InAppBrowser extends CordovaPlugin {
option = new StringTokenizer(features.nextToken(), "=");
if (option.hasMoreElements()) {
String key = option.nextToken();
Boolean value = option.nextToken().equals("no") ? Boolean.FALSE : Boolean.TRUE;
map.put(key, value);
if (key.equalsIgnoreCase(CLOSE_BUTTON_CAPTION)) {
this.buttonLabel = option.nextToken();
} else {
Boolean value = option.nextToken().equals("no") ? Boolean.FALSE : Boolean.TRUE;
map.put(key, value);
}
}
}
return map;
@@ -454,7 +460,6 @@ public class InAppBrowser extends CordovaPlugin {
return value;
}
@SuppressLint("NewApi")
public void run() {
// Let's create the main dialog
dialog = new InAppBrowserDialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar);
@@ -490,6 +495,9 @@ public class InAppBrowser extends CordovaPlugin {
back.setLayoutParams(backLayoutParams);
back.setContentDescription("Back Button");
back.setId(2);
/*
back.setText("<");
*/
Resources activityRes = cordova.getActivity().getResources();
int backResId = activityRes.getIdentifier("ic_action_previous_item", "drawable", cordova.getActivity().getPackageName());
Drawable backIcon = activityRes.getDrawable(backResId);
@@ -514,6 +522,7 @@ public class InAppBrowser extends CordovaPlugin {
forward.setLayoutParams(forwardLayoutParams);
forward.setContentDescription("Forward Button");
forward.setId(3);
//forward.setText(">");
int fwdResId = activityRes.getIdentifier("ic_action_next_item", "drawable", cordova.getActivity().getPackageName());
Drawable fwdIcon = activityRes.getDrawable(fwdResId);
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN)
@@ -553,13 +562,14 @@ public class InAppBrowser extends CordovaPlugin {
}
});
// Close/Done button
// Close button
Button close = new Button(cordova.getActivity());
RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
close.setLayoutParams(closeLayoutParams);
forward.setContentDescription("Close Button");
close.setId(5);
//close.setText(buttonLabel);
int closeResId = activityRes.getIdentifier("ic_action_remove", "drawable", cordova.getActivity().getPackageName());
Drawable closeIcon = activityRes.getDrawable(closeResId);
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN)
@@ -640,7 +650,7 @@ public class InAppBrowser extends CordovaPlugin {
// the goal of openhidden is to load the url and not display it
// Show() needs to be called to cause the URL to be loaded
if(openWindowHidden) {
dialog.hide();
dialog.hide();
}
}
};
@@ -673,6 +683,8 @@ public class InAppBrowser extends CordovaPlugin {
}
}
}
/**
* The webview client receives notifications about appView
@@ -803,6 +815,7 @@ public class InAppBrowser extends CordovaPlugin {
} catch (JSONException ex) {
Log.d(LOG_TAG, "Should never happen");
}
}
}
}

View File

@@ -25,16 +25,10 @@
var cordova = require('cordova'),
channel = require('cordova/channel'),
urlutil = require('cordova/urlutil');
channel = require('cordova/channel');
var browserWrap,
popup,
navigationButtonsDiv,
navigationButtonsDivInner,
backButton,
forwardButton,
closeButton;
popup;
// x-ms-webview is available starting from Windows 8.1 (platformId is 'windows')
// http://msdn.microsoft.com/en-us/library/windows/apps/dn301831.aspx
@@ -45,23 +39,14 @@ function attachNavigationEvents(element, callback) {
element.addEventListener("MSWebViewNavigationStarting", function (e) {
callback({ type: "loadstart", url: e.uri}, {keepCallback: true} );
});
element.addEventListener("MSWebViewNavigationCompleted", function (e) {
callback({ type: e.isSuccess ? "loadstop" : "loaderror", url: e.uri}, {keepCallback: true});
});
element.addEventListener("MSWebViewUnviewableContentIdentified", function (e) {
// WebView found the content to be not HTML.
// http://msdn.microsoft.com/en-us/library/windows/apps/dn609716.aspx
callback({ type: "loaderror", url: e.uri}, {keepCallback: true});
});
element.addEventListener("MSWebViewContentLoading", function (e) {
if (navigationButtonsDiv) {
backButton.disabled = !popup.canGoBack;
forwardButton.disabled = !popup.canGoForward;
}
});
} else {
var onError = function () {
callback({ type: "loaderror", url: this.contentWindow.location}, {keepCallback: true});
@@ -70,7 +55,6 @@ function attachNavigationEvents(element, callback) {
element.addEventListener("unload", function () {
callback({ type: "loadstart", url: this.contentWindow.location}, {keepCallback: true});
});
element.addEventListener("load", function () {
callback({ type: "loadstop", url: this.contentWindow.location}, {keepCallback: true});
});
@@ -104,10 +88,7 @@ var IAB = {
if (target === "_system") {
url = new Windows.Foundation.Uri(strUrl);
Windows.System.Launcher.launchUriAsync(url);
} else if (target === "_self" || !target) {
window.location = strUrl;
} else {
// "_blank" or anything else
} else if (target === "_blank") {
if (!browserWrap) {
browserWrap = document.createElement("div");
browserWrap.style.position = "absolute";
@@ -119,7 +100,7 @@ var IAB = {
browserWrap.onclick = function () {
setTimeout(function () {
IAB.close(win);
IAB.close();
}, 0);
};
@@ -133,91 +114,16 @@ var IAB = {
popup = document.createElement(isWebViewAvailable ? "x-ms-webview" : "iframe");
popup.style.borderWidth = "0px";
popup.style.width = "100%";
browserWrap.appendChild(popup);
if (features.indexOf("location=yes") !== -1 || features.indexOf("location") === -1) {
popup.style.height = "calc(100% - 60px)";
navigationButtonsDiv = document.createElement("div");
navigationButtonsDiv.style.height = "60px";
navigationButtonsDiv.style.backgroundColor = "#404040";
navigationButtonsDiv.style.zIndex = "999";
navigationButtonsDiv.onclick = function (e) {
e.cancelBubble = true;
};
navigationButtonsDivInner = document.createElement("div");
navigationButtonsDivInner.style.paddingTop = "10px";
navigationButtonsDivInner.style.height = "50px";
navigationButtonsDivInner.style.width = "160px";
navigationButtonsDivInner.style.margin = "0 auto";
navigationButtonsDivInner.style.backgroundColor = "#404040";
navigationButtonsDivInner.style.zIndex = "999";
navigationButtonsDivInner.onclick = function (e) {
e.cancelBubble = true;
};
backButton = document.createElement("button");
backButton.style.width = "40px";
backButton.style.height = "40px";
backButton.style.borderRadius = "40px";
backButton.innerText = "<-";
backButton.addEventListener("click", function (e) {
if (popup.canGoBack)
popup.goBack();
});
forwardButton = document.createElement("button");
forwardButton.style.marginLeft = "20px";
forwardButton.style.width = "40px";
forwardButton.style.height = "40px";
forwardButton.style.borderRadius = "40px";
forwardButton.innerText = "->";
forwardButton.addEventListener("click", function (e) {
if (popup.canGoForward)
popup.goForward();
});
closeButton = document.createElement("button");
closeButton.style.marginLeft = "20px";
closeButton.style.width = "40px";
closeButton.style.height = "40px";
closeButton.style.borderRadius = "40px";
closeButton.innerText = "x";
closeButton.addEventListener("click", function (e) {
setTimeout(function () {
IAB.close(win);
}, 0);
});
if (!isWebViewAvailable) {
// iframe navigation is not yet supported
backButton.disabled = true;
forwardButton.disabled = true;
}
navigationButtonsDivInner.appendChild(backButton);
navigationButtonsDivInner.appendChild(forwardButton);
navigationButtonsDivInner.appendChild(closeButton);
navigationButtonsDiv.appendChild(navigationButtonsDivInner);
browserWrap.appendChild(navigationButtonsDiv);
} else {
popup.style.height = "100%";
}
popup.style.height = "100%";
popup.src = strUrl;
// start listening for navigation events
attachNavigationEvents(popup, win);
if (isWebViewAvailable) {
strUrl = strUrl.replace("ms-appx://", "ms-appx-web://");
}
popup.src = strUrl;
browserWrap.appendChild(popup);
} else {
window.location = strUrl;
}
},
@@ -232,24 +138,16 @@ var IAB = {
op.start();
}
},
injectScriptFile: function (win, fail, args) {
var filePath = args[0],
var file = args[0],
hasCallback = args[1];
if (!!filePath) {
filePath = urlutil.makeAbsolute(filePath);
}
if (isWebViewAvailable && browserWrap && popup) {
var uri = new Windows.Foundation.Uri(filePath);
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done(function (file) {
Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
var op = popup.invokeScriptAsync("eval", code);
op.oncomplete = function () { hasCallback && win([]); };
op.onerror = function () { };
op.start();
});
Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
var op = popup.invokeScriptAsync("eval", code);
op.oncomplete = function () { hasCallback && win([]); };
op.onerror = function () { };
op.start();
});
}
}

View File

@@ -20,7 +20,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="org.apache.cordova.inappbrowser.tests"
version="0.5.4">
version="0.5.3">
<name>Cordova InAppBrowser Plugin Tests</name>
<license>Apache 2.0</license>

View File

@@ -19,17 +19,16 @@
*
*/
var cordova = require('cordova');
var isWindows = cordova.platformId == 'windows';
window.alert = window.alert || navigator.notification.alert;
exports.defineManualTests = function (contentEl, createActionButton) {
function doOpen(url, target, params, numExpectedRedirects) {
numExpectedRedirects = numExpectedRedirects || 0;
console.log("Opening " + url);
var iab = window.open(url, target, params);
if (!iab) {
alert('window.open returned ' + iab);
return;
}
var counts;
var lastLoadStartURL;
var wasReset = false;
@@ -44,17 +43,6 @@ exports.defineManualTests = function (contentEl, createActionButton) {
}
reset();
var iab = window.open(url, target, params, {
loaderror: logEvent,
loadstart: logEvent,
loadstop: logEvent,
exit: logEvent
});
if (!iab) {
alert('window.open returned ' + iab);
return;
}
function logEvent(e) {
console.log('IAB event=' + JSON.stringify(e));
counts[e.type]++;
@@ -92,6 +80,10 @@ exports.defineManualTests = function (contentEl, createActionButton) {
}
}
}
iab.addEventListener('loaderror', logEvent);
iab.addEventListener('loadstart', logEvent);
iab.addEventListener('loadstop', logEvent);
iab.addEventListener('exit', logEvent);
return iab;
}
@@ -175,7 +167,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
var info_div = '<h1>InAppBrowser</h1>' +
'<div id="info">' +
'Make sure http://cordova.apache.org and http://google.co.uk and https://www.google.co.uk are white listed. </br>' +
'Make sure http://www.google.com and https://www.google.com are white listed. </br>' +
'Make sure http://www.apple.com is not in the white list.</br>' +
'In iOS, starred <span style="vertical-align:super">*</span> tests will put the app in a state with no way to return. </br>' +
'<h4>User-Agent: <span id="user-agent"> </span></hr>' +
@@ -201,17 +193,17 @@ exports.defineManualTests = function (contentEl, createActionButton) {
var white_listed_tests = '<h1>White Listed URL</h1>' +
'<div id="openWhiteListed"></div>' +
'Expected result: open successfully in CordovaWebView to cordova.apache.org' +
'Expected result: open successfully in CordovaWebView to www.google.com' +
'<p/> <div id="openWhiteListedSelf"></div>' +
'Expected result: open successfully in CordovaWebView to cordova.apache.org' +
'Expected result: open successfully in CordovaWebView to www.google.com' +
'<p/> <div id="openWhiteListedSystem"></div>' +
'Expected result: open successfully in system browser to cordova.apache.org' +
'Expected result: open successfully in system browser to www.google.com' +
'<p/> <div id="openWhiteListedBlank"></div>' +
'Expected result: open successfully in InAppBrowser to cordova.apache.org' +
'Expected result: open successfully in InAppBrowser to www.google.com' +
'<p/> <div id="openWhiteListedRandom"></div>' +
'Expected result: open successfully in InAppBrowser to cordova.apache.org' +
'Expected result: open successfully in InAppBrowser to www.google.com' +
'<p/> <div id="openWhiteListedRandomNoLocation"></div>' +
'Expected result: open successfully in InAppBrowser to cordova.apache.org with no location bar.';
'Expected result: open successfully in InAppBrowser to www.google.com with no location bar.';
var non_white_listed_tests = '<h1>Non White Listed URL</h1>' +
'<div id="openNonWhiteListed"></div>' +
@@ -229,7 +221,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
var page_with_redirects_tests = '<h1>Page with redirect</h1>' +
'<div id="openRedirect301"></div>' +
'Expected result: should 301 and open successfully in InAppBrowser to https://www.google.co.uk.' +
'Expected result: should 301 and open successfully in InAppBrowser to www.google.com.' +
'<p/> <div id="openRedirect302"></div>' +
'Expected result: should 302 and open successfully in InAppBrowser to www.zhihu.com/answer/16714076.';
@@ -271,11 +263,11 @@ exports.defineManualTests = function (contentEl, createActionButton) {
'<div id="openHidden"></div>' +
'Expected result: no additional browser window. Alert appears with the text "background window loaded".' +
'<p/> <div id="showHidden"></div>' +
'Expected result: after first clicking on previous test "create hidden", open successfully in InAppBrowser to https://www.google.co.uk.' +
'Expected result: after first clicking on previous test "create hidden", open successfully in InAppBrowser to google.com.' +
'<p/> <div id="closeHidden"></div>' +
'Expected result: no output. But click on "show hidden" again and nothing should be shown.' +
'<p/> <div id="openHiddenShow"></div>' +
'Expected result: open successfully in InAppBrowser to https://www.google.co.uk';
'Expected result: open successfully in InAppBrowser to www.google.com';
var clearing_cache_tests = '<h1>Clearing Cache</h1>' +
'<div id="openClearCache"></div>' +
@@ -312,8 +304,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
var localhtml = basePath + 'local.html',
localpdf = basePath + 'local.pdf',
injecthtml = basePath + 'inject.html',
injectjs = isWindows ? basePath + 'inject.js' : 'inject.js',
injectcss = isWindows ? basePath + 'inject.css' : 'inject.css',
injectjs = 'inject.js',
injectcss = 'inject.css',
videohtml = basePath + 'video.html';
//Local
@@ -344,22 +336,22 @@ exports.defineManualTests = function (contentEl, createActionButton) {
//White Listed
createActionButton('* target=Default', function () {
doOpen('http://cordova.apache.org');
doOpen('https://www.google.com');
}, 'openWhiteListed');
createActionButton('* target=_self', function () {
doOpen('http://cordova.apache.org', '_self');
doOpen('https://www.google.com', '_self');
}, 'openWhiteListedSelf');
createActionButton('target=_system', function () {
doOpen('http://cordova.apache.org', '_system');
doOpen('https://www.google.com', '_system');
}, 'openWhiteListedSystem');
createActionButton('target=_blank', function () {
doOpen('http://cordova.apache.org', '_blank');
doOpen('https://www.google.com', '_blank');
}, 'openWhiteListedBlank');
createActionButton('target=Random', function () {
doOpen('http://cordova.apache.org', 'random_string');
doOpen('https://www.google.com', 'random_string');
}, 'openWhiteListedRandom');
createActionButton('* target=Random, no location bar', function () {
doOpen('http://cordova.apache.org', 'random_string', 'location=no');
doOpen('https://www.google.com', 'random_string', 'location=no');
}, 'openWhiteListedRandomNoLocation');
//Non White Listed
@@ -383,8 +375,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
}, 'openNonWhiteListedRandomNoLocation');
//Page with redirect
createActionButton('http://google.co.uk', function () {
doOpen('http://google.co.uk', 'random_string', '', 1);
createActionButton('http://google.com', function () {
doOpen('http://google.com', 'random_string', '', 1);
}, 'openRedirect301');
createActionButton('http://goo.gl/pUFqg', function () {
doOpen('http://goo.gl/pUFqg', 'random_string', '', 2);
@@ -440,7 +432,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
//Open hidden
createActionButton('Create Hidden', function () {
openHidden('https://www.google.co.uk', true);
openHidden('https://www.google.com', true);
}, 'openHidden');
createActionButton('Show Hidden', function () {
showHidden();
@@ -448,16 +440,16 @@ exports.defineManualTests = function (contentEl, createActionButton) {
createActionButton('Close Hidden', function () {
closeHidden();
}, 'closeHidden');
createActionButton('google.co.uk Not Hidden', function () {
openHidden('https://www.google.co.uk', false);
createActionButton('google.com Not Hidden', function () {
openHidden('https://www.google.com', false);
}, 'openHiddenShow');
//Clearing cache
createActionButton('Clear Browser Cache', function () {
doOpen('https://www.google.co.uk', '_blank', 'clearcache=yes');
doOpen('https://www.google.com', '_blank', 'clearcache=yes');
}, 'openClearCache');
createActionButton('Clear Session Cache', function () {
doOpen('https://www.google.co.uk', '_blank', 'clearsessioncache=yes');
doOpen('https://www.google.com', '_blank', 'clearsessioncache=yes');
}, 'openClearSessionCache');
//Video tag

View File

@@ -35,7 +35,7 @@ function InAppBrowser() {
InAppBrowser.prototype = {
_eventHandler: function (event) {
if (event && (event.type in this.channels)) {
if (event.type in this.channels) {
this.channels[event.type].fire(event);
}
},
@@ -77,7 +77,7 @@ InAppBrowser.prototype = {
}
};
module.exports = function(strUrl, strWindowName, strWindowFeatures, callbacks) {
module.exports = function(strUrl, strWindowName, strWindowFeatures) {
// Don't catch calls that write to existing frames (e.g. named iframes).
if (window.frames && window.frames[strWindowName]) {
var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
@@ -86,12 +86,6 @@ module.exports = function(strUrl, strWindowName, strWindowFeatures, callbacks) {
strUrl = urlutil.makeAbsolute(strUrl);
var iab = new InAppBrowser();
callbacks = callbacks || {};
for (var callbackName in callbacks) {
iab.addEventListener(callbackName, callbacks[callbackName]);
}
var cb = function(eventname) {
iab._eventHandler(eventname);
};