WebviewWindow

open external class WebviewWindow : Webview(source)

Constructors

Link copied to clipboard
constructor(label: WebviewLabel, options: WebviewWindowOptions = definedExternally)

Creates a new {@link Window} hosting a {@link Webview}.

Types

Link copied to clipboard
external object Companion

Set the window and webview background color.

Properties

Link copied to clipboard
open external override var label: String

The webview label. It is a unique identifier for the webview, can be used to reference it later.

Link copied to clipboard

Local event listeners.

Link copied to clipboard
external var window: Window

The window hosting this webview.

Functions

Link copied to clipboard
external fun <T> _handleTauriEvent(event: String, handler: EventCallback<T>): Boolean
Link copied to clipboard

Clears all browsing data for this webview.

Link copied to clipboard
external fun close(): Promise<Void>

Closes the webview.

Link copied to clipboard
external fun <T> emit(event: String, payload: T = definedExternally): Promise<Void>

Emits an event to all {@link EventTarget|targets}.

Link copied to clipboard
external fun <T> emitTo(target: EventTarget, event: String, payload: T = definedExternally): Promise<Void>
external fun <T> emitTo(target: String, event: String, payload: T = definedExternally): Promise<Void>

Emits an event to all {@link EventTarget|targets} matching the given target.

Link copied to clipboard
external fun hide(): Promise<Void>

Hide the webview.

Link copied to clipboard
open external override fun <T> listen(event: EventName, handler: EventCallback<T>): Promise<UnlistenFn>

Listen to an emitted event on this webview window.

Link copied to clipboard
open external override fun <T> once(event: EventName, handler: EventCallback<T>): Promise<UnlistenFn>

Listen to an emitted event on this webview window only once.

Link copied to clipboard

Listen to a file drop event. The listener is triggered when the user hovers the selected files on the webview, drops the files or cancels the operation.

Link copied to clipboard

The position of the top-left hand corner of the webview's client area relative to the top-left hand corner of the desktop.

Link copied to clipboard
external fun reparent(window: String): Promise<Void>
external fun reparent(window: WebviewWindow): Promise<Void>
external fun reparent(window: Window): Promise<Void>

Moves this webview to the given label.

Link copied to clipboard
external fun setAutoResize(autoResize: Boolean): Promise<Void>

Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes.

Link copied to clipboard
open external fun setBackgroundColor(color: Color?): Promise<Void>

Specify the webview background color.

Link copied to clipboard
external fun setFocus(): Promise<Void>

Bring the webview to front and focus.

Link copied to clipboard
external fun setPosition(position: LogicalPosition): Promise<Void>
external fun setPosition(position: PhysicalPosition): Promise<Void>
external fun setPosition(position: Position): Promise<Void>

Sets the webview position.

Link copied to clipboard
external fun setSize(size: LogicalSize): Promise<Void>
external fun setSize(size: PhysicalSize): Promise<Void>
external fun setSize(size: Size): Promise<Void>

Resizes the webview.

Link copied to clipboard
external fun setZoom(scaleFactor: Double): Promise<Void>

Set webview zoom level.

Link copied to clipboard
external fun show(): Promise<Void>

Show the webview.

Link copied to clipboard
external fun size(): Promise<PhysicalSize>

The physical size of the webview's client area. The client area is the content of the webview, excluding the title bar and borders.