pub unsafe extern "C" fn webview_bind(
w: webview_t,
name: *const c_char,
fn_: Option<unsafe extern "C" fn(id: *const c_char, req: *const c_char, arg: *mut c_void)>,
arg: *mut c_void,
) -> webview_error_tExpand description
Binds a function pointer to a new global JavaScript function.
Internally, JS glue code is injected to create the JS function by the given name. The callback function is passed a request identifier, a request string and a user-provided argument. The request string is a JSON array of the arguments passed to the JS function.
@param w The webview instance. @param name Name of the JS function. @param fn Callback function. @param arg User argument. @retval WEBVIEW_ERROR_DUPLICATE A binding already exists with the specified name.