6.0.0 • Published 1 year ago
capacitor-browser-view
Plugin to display Browser inside Capacitor App
Install
npm install capacitor-browser-view
npx cap sync
API
open(...)
open(options: OpenOptions) => Promise<void>
Param | Type |
---|
options | OpenOptions |
close()
close() => Promise<void>
loadUrl(...)
loadUrl(options: { url: string; }) => Promise<void>
Param | Type |
---|
options | { url: string; } |
handleNavigationEvent(...)
handleNavigationEvent(options: { allow: boolean; }) => Promise<void>
Param | Type |
---|
options | { allow: boolean; } |
goBack()
goBack() => Promise<void>
goForward()
goForward() => Promise<void>
reload()
reload() => Promise<void>
updateDimensions(...)
updateDimensions(options: Dimensions) => Promise<void>
Param | Type |
---|
options | Dimensions |
addListener('pageLoaded' | 'updateSnapshot' | 'progress' | 'navigationHandler', ...)
addListener(eventName: 'pageLoaded' | 'updateSnapshot' | 'progress' | 'navigationHandler', listenerFunc: (...args: any[]) => void) => Promise<PluginListenerHandle>
Param | Type |
---|
eventName | 'pageLoaded' | 'updateSnapshot' | 'progress' | 'navigationHandler' |
listenerFunc | (...args: any[]) => void |
Returns: Promise<PluginListenerHandle>
Interfaces
OpenOptions
Prop | Type |
---|
url | string |
script | { javascript: string; injectionTime?: ScriptInjectionTime; } |
element | HTMLElement |
userAgent | string |
Dimensions
Prop | Type |
---|
width | number |
height | number |
x | number |
y | number |
PluginListenerHandle
Prop | Type |
---|
remove | () => Promise<void> |
Enums
ScriptInjectionTime
Members |
---|
atDocumentStart |
atDocumentEnd |