webview_bind

abstract fun webview_bind(    webview: Pointer?,     name: String,     callback: WebviewJNA.WebviewLibrary.webview_bind_fn_callback,     arg: Pointer? = Pointer.NULL)

Binds a Kotlin or 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

webview

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.