Skip to content

Latest commit

 

History

History
217 lines (129 loc) · 4.67 KB

README.md

File metadata and controls

217 lines (129 loc) · 4.67 KB

capacitor-plugin-floatingweb

Capacitor plugin to create floating Webviews.

Install

npm install capacitor-plugin-floatingweb
npx cap sync

API

open(...)

open(options: OpenOptions) => Promise<void>

Open a webview with the given URL.

Param Type
options OpenOptions

close()

close() => Promise<void>

Close an open webview.


loadUrl(...)

loadUrl(options: { url: string; }) => Promise<void>

Load a url in the webview.

Param Type
options { url: string; }

goBack()

goBack() => Promise<void>

goForward()

goForward() => Promise<void>

reload()

reload() => Promise<void>

show()

show() => Promise<void>

hide()

hide() => Promise<void>

updateDimensions(...)

updateDimensions(options: Dimensions) => Promise<void>
Param Type
options Dimensions

addListener(keyof EventListenerMap, ...)

addListener(eventName: EventName, listener: PageloadListener | ProgressListener | NavigateListener) => PluginListenerHandle
Param Type
eventName keyof EventListenerMap
listener PageloadListener | ProgressListener | NavigateListener

Returns: PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

Interfaces

OpenOptions

Prop Type
url string
element HTMLElement
userAgent string
wideViewport boolean

Dimensions

Prop Type
width number
height number
x number
y number
scale number

PluginListenerHandle

Prop Type
remove () => Promise<void>

Type Aliases

EventName

keyof EventListenerMap

EventListenerMap

{ pageLoad: PageloadListener; progress: ProgressListener; navigate: NavigateListener; }

PageloadListener

(): void

ProgressListener

(event: { value: number; }): void

NavigateListener

(event: { url: string; newWindow: boolean; sameHost: boolean; }): void