WebviewKo

expect class WebviewKo(debug: Int = 0, libPath: String? = null)

The Kotlin Multiplatform binding to webview

actual class WebviewKo(debug: Int, libPath: String?)

The Kotlin/JS binding to webview

actual class WebviewKo(debug: Int, libPath: String?)

The Kotlin/JVM binding to webview

actual class WebviewKo(debug: Int, libPath: String?)

The Kotlin/Native binding to webview

Parameters

debug

enable debug mode for webview

libPath

The lib's path. Not supported in Kotlin/Native

debug

enable debug mode for webview

libPath

The lib's path.

debug

enable debug mode for webview

libPath

The lib's path.

debug

enable debug mode for webview

libPath

not supported in Kotlin/Native

Constructors

Link copied to clipboard
expect fun WebviewKo(debug: Int = 0, libPath: String? = null)
actual fun WebviewKo(debug: Int, libPath: String?)

create a webview or throws Exception if failed

actual fun WebviewKo(debug: Int, libPath: String?)

create a webview or throws Exception if failed

actual fun WebviewKo(debug: Int, libPath: String?)

create a webview or throws Exception if failed

Types

Link copied to clipboard
expect class JSRejectException(reason: String? = null, json: String? = null) : Throwable

Should be used in bind to throw an exception in JS

actual class JSRejectException(reason: String?, json: String?) : Throwable

Should be used in bind to throw an exception in JS

actual class JSRejectException(reason: String?, json: String?) : Throwable

Should be used in bind to throw an exception in JS

actual class JSRejectException(reason: String?, json: String?) : Throwable

Should be used in bind to throw an exception in JS

Link copied to clipboard
expect enum WindowHint : Enum<WebviewKo.WindowHint>

The window size hints used by WebviewKo.size

actual enum WindowHint : Enum<WebviewKo.WindowHint>

The window size hints used by WebviewKo.size

actual enum WindowHint : Enum<WebviewKo.WindowHint>

The window size hints used by WebviewKo.size

actual enum WindowHint : Enum<WebviewKo.WindowHint>

Functions

Link copied to clipboard
expect fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

actual fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

actual fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

actual fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

Link copied to clipboard
expect fun destroy()

Destroy the webview and close the native window.

actual fun destroy()

Destroy the webview and close the native window.

actual fun destroy()

Destroy the webview and close the native window.

actual fun destroy()

Destroy the webview and close the native window.

Link copied to clipboard
expect fun dispatch(fn: WebviewKo.() -> Unit)

Posts a function to be executed on the main thread.

actual fun dispatch(fn: WebviewKo.() -> Unit)

Posts a function to be executed on the main thread.

actual fun dispatch(fn: WebviewKo.() -> Unit)

Posts a function to be executed on the main thread.

actual fun dispatch(fn: WebviewKo.() -> Unit)

Posts a function to be executed on the main thread.

Link copied to clipboard
expect fun eval(js: String)

Evaluates arbitrary JS code.

actual fun eval(js: String)

Evaluates arbitrary JS code.

actual fun eval(js: String)

Evaluates arbitrary JS code.

actual fun eval(js: String)

Evaluates arbitrary JS code.

getWebviewPointer
Link copied to clipboard
fun getWebviewPointer(): Pointer

Return the Pointer of the webview.

fun getWebviewPointer(): CPointer<out CPointed>

Return the C Pointer of the webview.

Link copied to clipboard
expect fun html(v: String)

Set webview HTML directly.

actual fun html(v: String)

Set webview HTML directly.

actual fun html(v: String)

Set webview HTML directly.

actual fun html(v: String)

Set webview HTML directly.

Link copied to clipboard
expect fun init(js: String)

Injects JS code at the initialization of the new page.

actual fun init(js: String)

Injects JS code at the initialization of the new page.

actual fun init(js: String)

Injects JS code at the initialization of the new page.

actual fun init(js: String)

Injects JS code at the initialization of the new page.

Link copied to clipboard
expect fun navigate(url: String)

Navigates webview to the given URL

actual fun navigate(url: String)

Navigates webview to the given URL

actual fun navigate(url: String)

Navigates webview to the given URL

actual fun navigate(url: String)

Navigates webview to the given URL

Link copied to clipboard
expect fun show()

Runs the main loop until it's terminated and destroy the webview after that.

actual fun show()

Runs the main loop until it's terminated and destroy the webview after that.

actual fun show()

Runs the main loop until it's terminated and destroy the webview after that.

actual fun show()

Runs the main loop until it's terminated and destroy the webview after that.

Link copied to clipboard
expect fun size(    width: Int,     height: Int,     hints: WebviewKo.WindowHint = WindowHint.None)

Updates the size of the native window.

actual fun size(    width: Int,     height: Int,     hints: WebviewKo.WindowHint)

Updates the size of the native window.

actual fun size(    width: Int,     height: Int,     hints: WebviewKo.WindowHint)

Updates the size of the native window.

actual fun size(    width: Int,     height: Int,     hints: WebviewKo.WindowHint)

Updates the size of the native window.

Link copied to clipboard
expect fun start()

Runs the main loop until it's terminated. After this function exits - you must destroy the webview.

actual fun start()

Runs the main loop until it's terminated. After this function exits - you must destroy the webview.

actual fun start()

Runs the main loop until it's terminated. After this function exits - you must destroy the webview.

actual fun start()

Runs the main loop until it's terminated. After this function exits - you must destroy the webview.

Link copied to clipboard
expect fun terminate()

Stops the main loop.

actual fun terminate()

Runs the main loop until it's terminated. After this function exits - you must destroy the webview.

actual fun terminate()

Stops the main loop.

actual fun terminate()

Stops the main loop.

Link copied to clipboard
expect fun title(v: String)

Updates the title of the native window.

actual fun title(v: String)

Updates the title of the native window.

actual fun title(v: String)

Updates the title of the native window.

actual fun title(v: String)

Updates the title of the native window.

Link copied to clipboard
expect fun unbind(name: String)

Removes a callback that was previously set by webview_bind.

actual fun unbind(name: String)

Removes a callback that was previously set by webview_bind.

actual fun unbind(name: String)

Removes a callback that was previously set by webview_bind.

actual fun unbind(name: String)

Removes a callback that was previously set by webview_bind.

Link copied to clipboard
expect fun url(v: String)

Navigates webview to the given URL

actual fun url(v: String)

Navigates webview to the given URL

actual fun url(v: String)

Navigates webview to the given URL

actual fun url(v: String)

Navigates webview to the given URL