WebviewKo

expect class WebviewKo(debug: Int = 0)

The Kotlin Multiplatform binding to webview

actual class WebviewKo(debug: Int)

The JVM binding to webview in Kotlin

actual class WebviewKo(debug: Int)

The Kotlin/Native binding to webview

Constructors

Link copied to clipboard
expect fun WebviewKo(debug: Int = 0)

create a webview or throws Exception if failed

actual fun WebviewKo(debug: Int)

create a webview or throws Exception if failed

actual fun WebviewKo(debug: Int)

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

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>

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.

Link copied to clipboard
fun cBind(    name: String,     callback: CPointer<CFunction<(CPointer<ByteVar>?, CPointer<ByteVar>?, COpaquePointer?) -> Unit>>?,     arg: CValuesRef<*>)

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

Link copied to clipboard
fun cDispatch(fn: CPointer<CFunction<(webview_t?, COpaquePointer?) -> Unit>>?, args: CValuesRef<*>)

Posts a C function to be executed on the main thread.

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.

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.

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(url: String)

Set webview HTML directly.

actual fun html(url: String)

Set webview HTML directly.

actual fun html(url: 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.

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

Navigates webview to the given URL

actual fun navigate(v: String)

Navigates webview to the given URL

actual fun navigate(v: String)

Navigates webview to the given URL

Link copied to clipboard
expect fun show()

Runs the main loop and destroy it when terminated.

actual fun show()

Runs the main loop and destroy it when terminated.

actual fun show()

Runs the main loop and destroy it when terminated.

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.

Link copied to clipboard
expect fun terminate()

Stops the main loop.

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.

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.

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