capacitor-webview-controller
v0.0.13
Published
control capacitorjs webviews cross platform.
Downloads
3
Maintainers
Readme
capacitor-webview-controller
control webviews cross platform using capacitor.js.
Install
npm install capacitor-webview-controller
npx cap sync
API
loadURL(...)
closeWindow()
evaluateJavaScript(...)
show()
hide()
addListener('navigation', ...)
addListener('page loaded', ...)
addListener('closed', ...)
- Interfaces
- Type Aliases
loadURL(...)
loadURL(options: { url: string; }) => Promise<void>
| Param | Type |
| ------------- | ----------------------------- |
| options
| { url: string; } |
closeWindow()
closeWindow() => Promise<void>
evaluateJavaScript(...)
evaluateJavaScript(options: { javascript: string; }) => Promise<{ result: string; }>
| Param | Type |
| ------------- | ------------------------------------ |
| options
| { javascript: string; } |
Returns: Promise<{ result: string; }>
show()
show() => Promise<void>
hide()
hide() => Promise<void>
addListener('navigation', ...)
addListener(event: "navigation", listener: (args: PageEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| -------------- | ------------------------------------------------------------------ |
| event
| 'navigation' |
| listener
| (args: PageEvent) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener('page loaded', ...)
addListener(event: "page loaded", listener: (args: PageEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| -------------- | ------------------------------------------------------------------ |
| event
| 'page loaded' |
| listener
| (args: PageEvent) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener('closed', ...)
addListener(event: "closed", listener: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| -------------- | -------------------------- |
| event
| 'closed' |
| listener
| () => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Type Aliases
PageEvent
{ url: string }