WebviewKo

public final class WebviewKo

The High level binding to webview in Kotlin

Constructors

Link copied to clipboard
public WebviewKo WebviewKo(Integer debug)

Types

Link copied to clipboard
public enum WindowHint extends Enum<WebviewKo.WindowHint>

The window size hints used by WebviewKo.size

Functions

Link copied to clipboard
public final Unit bind(String name, Function2<WebviewKo, String, String> fn)

Binds a native Kotlin/Java callback so that it will appear under the given name as a global JavaScript function.

Link copied to clipboard
public final Unit dispatch(Function1<WebviewKo, Unit> fn)

Posts a function to be executed on the main thread.

Link copied to clipboard
public final Unit eval(String js)

Evaluates arbitrary JavaScript code.

Link copied to clipboard
public final Unit html(String v)

Set webview HTML directly.

Link copied to clipboard
public final Unit init(String js)

Injects JavaScript code at the initialization of the new page.

Link copied to clipboard
public final Unit initJS(String js)

Injects JavaScript code at the initialization of the new page.

Link copied to clipboard
public final Unit navigate(String v)

Navigates webview to the given URL

Link copied to clipboard
public final Unit show()

Runs the main loop and destroy it when terminated.

Link copied to clipboard
public final Unit size(    Integer width,     Integer height,     WebviewKo.WindowHint hints)

Updates the size of the native window.

Link copied to clipboard
public final Unit terminate()

Stops the main loop.

Link copied to clipboard
public final Unit title(String v)

Updates the title of the native window.

Link copied to clipboard
public final Unit unbind(String name)

Removes a callback that was previously set by webview_bind.

Link copied to clipboard
public final Unit url(String v)

Navigates webview to the given URL