6.0.6 • Published 4 days ago

@capgo/inappbrowser v6.0.6

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

@capgo/inappbrowser

Install

npm install @capgo/inappbrowser
npx cap sync

Usage

import { InAppBrowser } from '@capgo/inappbrowser'

InAppBrowser.open({ url: "YOUR_URL" });

Web platform is not supported. Use window.open instead.

Camera usage

if you need the Camera to work in Android, you need to add the following to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.CAMERA" />

Then the permission will be asked when the camera is used.

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(options: ClearCookieOptions) => Promise<any>

Clear cookies of url

ParamType
optionsClearCookieOptions

Returns: Promise<any>

Since: 0.5.0


getCookies(...)

getCookies(options: GetCookieOptions) => Promise<Record<string, string>>

Get cookies for a specific URL.

ParamTypeDescription
optionsGetCookieOptionsThe options, including the URL to get cookies for.

Returns: Promise<Record<string, string>>


close()

close() => Promise<any>

Returns: Promise<any>


openWebView(...)

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

Open url in a new webview with toolbars

ParamType
optionsOpenWebViewOptions

Returns: Promise<any>

Since: 0.1.0


executeScript(...)

executeScript({ code }: { code: string; }) => Promise<void>

Injects JavaScript code into the InAppBrowser window.

ParamType
__0{ code: string; }

setUrl(...)

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

Returns: Promise<any>


addListener('urlChangeEvent', ...)

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

Listen for url change, only for openWebView

ParamType
eventName'urlChangeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle>

Since: 0.0.1


addListener('closeEvent', ...)

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

Listen for close click only for openWebView

ParamType
eventName'closeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle>

Since: 0.4.0


addListener('confirmBtnClicked', ...)

addListener(eventName: "confirmBtnClicked", listenerFunc: ConfirmBtnListener) => Promise<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>

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

ClearCookieOptions

PropType
urlstring
cacheboolean

HttpCookie

PropTypeDescription
urlstringThe URL of the cookie.
keystringThe key of the cookie.
valuestringThe value of the cookie.

GetCookieOptions

PropType
urlstring
includeHttpOnlyboolean

OpenWebViewOptions

PropTypeDescriptionDefaultSince
urlstringTarget URL to load.0.1.0
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
activeNativeNavigationForWebviewbooleanIf true, active the native navigation within the webview, Android onlyfalse
disableGoBackOnNativeApplicationbooleanDisable the possibility to go back on native application, usefull to force user to stay on the webview, Android onlyfalse
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
isInspectablebooleanWhether the website in the webview is inspectable or not, ios onlyfalse
isAnimatedbooleanWhether the webview opening is animated or not, ios onlytrue
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

ClearCookieOptions

Omit<HttpCookie, 'key' | 'value'>

Omit

Construct a type with the properties of T except for those in type K.

Pick<T, Exclude<keyof T, K>>

Pick

From T, pick a set of properties whose keys are in the union K

{ P in K: TP; }

Exclude

Exclude from T those types that are assignable to U

T extends U ? never : T

Record

Construct a type with a set of properties K of type T

{

}

GetCookieOptions

Omit<HttpCookie, 'key' | 'value'>

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

6.0.6

4 days ago

6.0.3

4 days ago

6.0.5

4 days ago

6.0.4

4 days ago

6.0.2

10 days ago

1.4.4

11 days ago

1.4.3

11 days ago

1.4.2

25 days ago

1.4.1

2 months ago

1.4.0

2 months ago

1.3.17

2 months ago

1.3.16

2 months ago

1.3.15

2 months ago

1.3.3

4 months ago

1.3.1

4 months ago

1.2.20

4 months ago

1.2.8

8 months ago

1.2.7

8 months ago

1.0.7

9 months ago

1.2.4

8 months ago

1.0.6

9 months ago

1.2.3

8 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.2.12

7 months ago

1.2.13

7 months ago

1.2.16

7 months ago

1.2.17

6 months ago

1.2.14

7 months ago

1.2.15

7 months ago

1.2.18

6 months ago

1.2.19

6 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.2

11 months ago

10.0.0

12 months ago

2.0.0

12 months ago

12.0.0

12 months ago

3.0.0

12 months ago

4.0.0

12 months ago

0.5.0

12 months ago

11.0.0

12 months ago

5.0.0

12 months ago

6.0.0

12 months ago

13.0.0

11 months ago

7.0.0

12 months ago

8.0.0

12 months ago

0.4.15

12 months ago

0.4.13

1 year ago

0.4.14

1 year ago

0.4.11

1 year ago

0.4.12

1 year ago

9.0.0

12 months ago

0.6.0

12 months ago

0.4.9

1 year ago

0.4.8

1 year ago

0.4.10

1 year ago

0.3.20

1 year ago

0.3.22

1 year ago

0.3.21

1 year ago

0.3.19

1 year ago

0.4.7

1 year ago

0.4.6

1 year ago

0.4.1

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.3.0

2 years ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.7

1 year ago

0.3.1

2 years ago

0.3.4

1 year ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.4

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago