capacitor-browser-view
v6.0.0
Published
Plugin to display Browser inside Capacitor App
Downloads
3
Readme
capacitor-browser-view
Plugin to display Browser inside Capacitor App
Install
npm install capacitor-browser-view
npx cap sync
API
open(...)
close()
loadUrl(...)
handleNavigationEvent(...)
goBack()
goForward()
reload()
updateDimensions(...)
addListener('pageLoaded' | 'updateSnapshot' | 'progress' | 'navigationHandler', ...)
- Interfaces
- Enums
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
|