1.2.25 • Published 4 months ago

@sakhnovict/inappbrowser v1.2.25

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@capgo/inappbrowser

Install

npm install @capgo/inappbrowser
npx cap sync

Usage

import { InAppBrowser } from '@capgo/inappbrowser'

InAppBrowser.open("YOUR_URL");

API

open(...)

open(options: OpenOptions) => Promise<any>

Open url in a new window fullscreen

ParamType
optionsOpenOptions

Returns: Promise<any>

Since: 0.1.0


clearCookies()

clearCookies() => Promise<any>

Clear all cookies

Returns: Promise<any>

Since: 0.5.0


close()

close() => Promise<any>

Returns: Promise<any>


openWebViewWithHTML(...)

openWebViewWithHTML(options: OpenWebViewOptionsWithHtmlString) => Promise<any>

Open webview with given html string.

ParamTypeDescription
optionsOpenWebViewOptionsWithHtmlStringWebView options

Returns: Promise<any>


openWebView(...)

openWebView(options: OpenWebViewOptionsWithUrl) => Promise<any>

Open url in a new webview with toolbars

ParamType
optionsOpenWebViewOptionsWithUrl

Returns: Promise<any>

Since: 0.1.0


setUrl(...)

setUrl(options: { url: string; }) => Promise<any>
ParamType
options{ url: string; }

Returns: Promise<any>


addListener('urlChangeEvent', ...)

addListener(eventName: "urlChangeEvent", listenerFunc: UrlChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for url change, only for openWebView

ParamType
eventName'urlChangeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1


addListener('closeEvent', ...)

addListener(eventName: "closeEvent", listenerFunc: UrlChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for close click only for openWebView

ParamType
eventName'closeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.4.0


addListener('confirmBtnClicked', ...)

addListener(eventName: "confirmBtnClicked", listenerFunc: ConfirmBtnListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS

ParamType
eventName'confirmBtnClicked'
listenerFuncConfirmBtnListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 1.0.0


reload()

reload() => Promise<any>

Reload the current web page.

Returns: Promise<any>

Since: 1.0.0


Interfaces

OpenOptions

PropTypeDescriptionSince
urlstringTarget URL to load.0.1.0
headersHeadersHeaders to send with the request.0.1.0
isPresentAfterPageLoadbooleanif true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.0.1.0
preventDeeplinkboolean

Headers

OpenWebViewBaseOptions

PropTypeDescriptionDefaultSince
headersHeadersHeaders to send with the request.0.1.0
shareDisclaimerDisclaimerOptionsshare options0.1.0
toolbarTypeToolBarTypeToolbar typeToolBarType.DEFAULT0.1.0
shareSubjectstringShare subject0.1.0
titlestringTitle of the browser'New Window'0.1.0
backgroundColorBackgroundColorBackground color of the browser, only on IOSBackgroundColor.BLACK0.1.0
isPresentAfterPageLoadbooleanOpen url in a new window fullscreen isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.false0.1.0
showReloadButtonbooleanShows a reload button that reloads the web pagefalse1.0.15
closeModalbooleanCloseModal: if true a confirm will be displayed when user clicks on close button, if false the browser will be closed immediately.false1.1.0
closeModalTitlestringCloseModalTitle: title of the confirm when user clicks on close button, only on IOS'Close'1.1.0
closeModalDescriptionstringCloseModalDescription: description of the confirm when user clicks on close button, only on IOS'Are you sure you want to close this window?'1.1.0
closeModalOkstringCloseModalOk: text of the confirm button when user clicks on close button, only on IOS'Close'1.1.0
closeModalCancelstringCloseModalCancel: text of the cancel button when user clicks on close button, only on IOS'Cancel'1.1.0
visibleTitlebooleanvisibleTitle: if true the website title would be shown else shown emptytrue1.2.5
toolbarColorstringtoolbarColor: color of the toolbar in hex format'#ffffff''1.2.5
showArrowbooleanshowArrow: if true an arrow would be shown instead of cross for closing the windowfalse1.2.5

DisclaimerOptions

PropType
titlestring
messagestring
confirmBtnstring
cancelBtnstring

PluginListenerHandle

PropType
remove() => Promise<void>

UrlEvent

PropTypeDescriptionSince
urlstringEmit when the url changes0.0.1

BtnEvent

PropTypeDescriptionSince
urlstringEmit when a button is clicked.0.0.1

Type Aliases

OpenWebViewOptionsWithHtmlString

OpenWebViewBaseOptions & { /** HTML string to load as an alternative to url. / htmlString: string; }

OpenWebViewOptionsWithUrl

OpenWebViewBaseOptions & { /** Target URL to load. @since 0.1.0 */ url: string; }

UrlChangeListener

(state: UrlEvent): void

ConfirmBtnListener

(state: BtnEvent): void

Enums

ToolBarType

MembersValue
ACTIVITY"activity"
NAVIGATION"navigation"
BLANK"blank"
DEFAULT""

BackgroundColor

MembersValue
WHITE"white"
BLACK"black"

Credits

1.2.25

4 months ago

1.2.24

5 months ago

1.2.23

5 months ago

1.2.22

5 months ago

1.2.21

5 months ago

1.2.20

7 months ago

1.2.18

7 months ago

1.2.17

7 months ago

1.2.16

7 months ago