class Webview::Webview

Included Modules

Defined in:

lib/webview/src/webview.cr
lune/webview.cr

Instance Method Summary

Instance methods inherited from module Lune::WebviewLike

bind_deferred(name : String, &block : String, Array(JSON::Any) -> Nil) bind_deferred, dispatch(&) dispatch, eval(js : String) eval, resolve(seq : String, status : Int32, result : String) resolve

Instance Method Detail

def bind_deferred(name : String, &block : String, Array(JSON::Any) -> Nil) #

Registers a JS-callable function but does NOT auto-call webview_return. The block receives (seq, args). Call resolve(seq, ...) whenever ready.


[View source]
def resolve(seq : String, status : Int32, result : String) #

Send a response to a pending JS promise from bind_deferred. status: 0 = success, non-zero = error. result must be valid JSON.


[View source]