@nadlowebagentur/capacitor-in-app-browser
v0.0.16
Published
Open InApp webView based browser
Downloads
139
Readme
capacitor-in-app-browser
Open InApp webView based browser
Install
npm install capacitor-in-app-browser
npx cap syncAPI
open(...)navigate(...)close()back()forward()reload()canGoForward()canGoBack()setMode(...)addListener('urlChanged', ...)- Interfaces
open(...)
open(options: { url: string; marginTop?: number; allowedOrigins?: string[]; blockedOrigins?: string[]; blockTitle?: string; blockMessage?: string; strictOrigin?: boolean; userAgent?: string; }) => Promise<void>| Param | Type |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options | { url: string; marginTop?: number; allowedOrigins?: string[]; blockedOrigins?: string[]; blockTitle?: string; blockMessage?: string; strictOrigin?: boolean; userAgent?: string; } |
navigate(...)
navigate(options: { url: string; }) => Promise<void>| Param | Type |
| ------------- | ----------------------------- |
| options | { url: string; } |
close()
close() => Promise<void>back()
back() => Promise<void>forward()
forward() => Promise<void>reload()
reload() => Promise<void>canGoForward()
canGoForward() => Promise<{ value: boolean; }>Returns: Promise<{ value: boolean; }>
canGoBack()
canGoBack() => Promise<{ value: boolean; }>Returns: Promise<{ value: boolean; }>
setMode(...)
setMode(params: { mode: 'front' | 'back'; }) => Promise<void>Controls whether the native in-app browser view is rendered in front of or behind the app WebView.
front: show the native in-app browser on top.back: place the native in-app browser behind the web layer.
| Param | Type |
| ------------ | ----------------------------------------- |
| params | { mode: 'front' | 'back'; } |
addListener('urlChanged', ...)
addListener(eventName: 'urlChanged', listenerFunc: (data: { url: string; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandleiOS only: Listen for the browser url changed event. It fires when the Browser navigate to other URL.
| Param | Type |
| ------------------ | ------------------------------------------------ |
| eventName | 'urlChanged' |
| listenerFunc | (data: { url: string; }) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 0.0.1
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
