Inappbrowser

v3.0.0

Contents

インストール

Ionic Enterprise Editionのプラグインを利用する場合は、 通常のバージョンでスコープ指定されたプラグインに問題がある可能性があるため、 Ionic Enterprise Cordova CLIを使用していることを確認する必要があります。

npm uninstall -g cordovanpm install -g @ionic-enterprise/cordova

Ionic Enterprise Cordova CLIをインストールしたら、プラグインをインストールできます。

ionic enterprise register --key=YOURPRODUCTKEYionic cordova plugin add @ionic-enterprise/inappbrowser

Index

Classes

Interfaces


Classes

InAppBrowser

InAppBrowser:

name: In App Browser

description: Launches in app Browser

usage:

import { InAppBrowser } from '@ionic-enterprise/inappbrowser/ngx';

constructor(private iab: InAppBrowser) { }

...

const browser = this.iab.create('https://ionicframework.com/');

browser.executeScript(...);

browser.insertCSS(...);
browser.on('loadstop').subscribe(event => {
   browser.insertCSS({ code: "body{color: red;" });
});

browser.close();

classes: InAppBrowserObject

interfaces: InAppBrowserEvent InAppBrowserOptions

create

create(url: string, target?: string, options?: string | InAppBrowserOptions): InAppBrowserObject

Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.

Parameters:

Name Type Description
url string The URL to load.
Optional target string The target in which to load the URL, an optional parameter that defaults to _self.
Optional options string | InAppBrowserOptions Options for the InAppBrowser. Optional, defaulting to: location=yes. The options string must not contain any blank space, and each feature's name/value pairs must be separated by a comma. Feature names are case insensitive.

Returns: InAppBrowserObject



Interfaces

InAppBrowserEvent

InAppBrowserEvent:

AT_TARGET

● AT_TARGET: number


BUBBLING_PHASE

● BUBBLING_PHASE: number


CAPTURING_PHASE

● CAPTURING_PHASE: number


Event

● Event: object

Type declaration

constructor : function ⊕ new __type(type: string, eventInitDict?: EventInit): Event

Parameters:

Name Type
type string
Optional eventInitDict EventInit

Returns: Event

AT_TARGET: number

BUBBLING_PHASE: number

CAPTURING_PHASE: number

NONE: number

prototype: Event


NONE

● NONE: number


bubbles

● bubbles: boolean

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.


cancelBubble

● cancelBubble: boolean


cancelable

● cancelable: boolean


code

● code: number

the error code, only in the case of loaderror.


composed

● composed: boolean

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.


currentTarget

● currentTarget: EventTarget | null

Returns the object whose event listener's callback is currently being invoked.


defaultPrevented

● defaultPrevented: boolean


eventPhase

● eventPhase: number


isTrusted

● isTrusted: boolean

Returns true if event was dispatched by the user agent, and false otherwise.


message

● message: string

the error message, only in the case of loaderror.


returnValue

● returnValue: boolean


srcElement

● srcElement: Element | null

deprecated:


target

● target: EventTarget | null

Returns the object to which event is dispatched (its target).


timeStamp

● timeStamp: number

Returns the event's timestamp as the number of milliseconds measured relative to the time origin.


type

● type: string

the eventname, either loadstart, loadstop, loaderror, or exit.


url

● url: string

the URL that was loaded.


composedPath

composedPath(): EventTarget[]

Returns: EventTarget[]


initEvent

initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void

Parameters:

Name Type
type string
Optional bubbles boolean
Optional cancelable boolean

Returns: void


preventDefault

preventDefault(): void

Returns: void


stopImmediatePropagation

stopImmediatePropagation(): void

Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.

Returns: void


stopPropagation

stopPropagation(): void

When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.

Returns: void



InAppBrowserOptions

InAppBrowserOptions:

<Optional> allowInlineMediaPlayback

● allowInlineMediaPlayback: *"yes" | "no"*


<Optional> clearcache

● clearcache: *"yes"*

Set to yes to have the browser's cookie cache cleared before the new window is opened.


<Optional> clearsessioncache

● clearsessioncache: *"yes"*


<Optional> closebuttoncaption

● closebuttoncaption: string


<Optional> closebuttoncolor

● closebuttoncolor: string


<Optional> disallowoverscroll

● disallowoverscroll: *"yes" | "no"*

(iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property.


<Optional> enableViewportScale

● enableViewportScale: *"yes" | "no"*

(iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no).


● footer: *"yes" | "no"*

(Android Only) Set to yes to show a close button in the footer similar to the iOS Done button. The close button will appear the same as for the header hence use closebuttoncaption and closebuttoncolor to set its properties


<Optional> footercolor

● footercolor: string

(Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb), and it will change the footer color from default. Only has effect if user has footer set to yes


<Optional> fullscreen

● fullscreen: *"yes"*


<Optional> hardwareback

● hardwareback: *"yes" | "no"*


<Optional> hidden

● hidden: *"yes" | "no"*


<Optional> hidenavigationbuttons

● hidenavigationbuttons: *"yes" | "no"*


<Optional> hidespinner

● hidespinner: *"yes" | "no"*

(iOS Only) Set to yes or no to change the visibility of the loading indicator (defaults to no).


<Optional> hideurlbar

● hideurlbar: *"yes" | "no"*


<Optional> keyboardDisplayRequiresUserAction

● keyboardDisplayRequiresUserAction: *"yes" | "no"*

(iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes).


<Optional> location

● location: *"yes" | "no"*

Set to yes or no to turn the InAppBrowser's location bar on or off.


<Optional> mediaPlaybackRequiresUserAction

● mediaPlaybackRequiresUserAction: *"yes" | "no"*


<Optional> navigationbuttoncolor

● navigationbuttoncolor: string


<Optional> presentationstyle

● presentationstyle: *"pagesheet" | "formsheet" | "fullscreen"*

(iOS Only) Set to pagesheet, formsheet or fullscreen to set the presentation style (defaults to fullscreen).


<Optional> shouldPauseOnSuspend

● shouldPauseOnSuspend: *"yes" | "no"*

(Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues)


<Optional> suppressesIncrementalRendering

● suppressesIncrementalRendering: *"yes" | "no"*

(iOS Only) Set to yes or no to wait until all new view content is received before being rendered (defaults to no).


<Optional> toolbar

● toolbar: *"yes" | "no"*

(iOS Only) Set to yes or no to turn the toolbar on or off for the InAppBrowser (defaults to yes)


<Optional> toolbarcolor

● toolbarcolor: string


<Optional> toolbarposition

● toolbarposition: *"top" | "bottom"*

(iOS Only) Set to top or bottom (default is bottom). Causes the toolbar to be at the top or bottom of the window.


<Optional> toolbartranslucent

● toolbartranslucent: *"yes" | "no"*

(iOS Only) Set to yes or no to make the toolbar translucent(semi-transparent) (defaults to yes). Only applicable if toolbar is not disabled.


<Optional> transitionstyle

● transitionstyle: *"fliphorizontal" | "crossdissolve" | "coververtical"*

(iOS Only) Set to fliphorizontal, crossdissolve or coververtical to set the transition style (defaults to coververtical).


<Optional> useWideViewPort

● useWideViewPort: *"yes" | "no"*

(Android Only) Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is no, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is yes and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. (defaults to yes).


<Optional> zoom

● zoom: *"yes" | "no"*

(Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes.



Other Versions