webview_bind

public final Unit webview_bind(    CPointer<? extends CPointed> w,     String name,     CPointer<CFunction<Function3<CPointer<ByteVarOf<Byte>>, CPointer<ByteVarOf<Byte>>, CPointer<? extends CPointed>, Unit>>> callback,     CValuesRef<?> arg)

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

Callback receives a request string. Request string is a JSON array of all the arguments passed to the JavaScript function. Internally it uses webview_init.

Parameters

w

the handle of webview, usually returned by webview_create

name

the name of the global JavaScript function

callback

the Kotlin/Java callback function wrapper in an interface, use webview_return to response to the JS request.

arg

the context. please keep it Pointer.NULL unless you know what you're doing.