onScriptMessageWithReplyReceived

fun onScriptMessageWithReplyReceived(connectFlags: <Error class: unknown class> = ConnectFlags(0u), detail: String? = null, handler: (<Error class: unknown class>, reply: ScriptMessageReply) -> Boolean): <Error class: unknown class>(source)

This signal is emitted when JavaScript in a web view calls window.webkit.messageHandlers..postMessage(), after registering using webkit_user_content_manager_register_script_message_handler_with_reply()

The given @reply can be used to send a return value with webkit_script_message_reply_return_value() or an error message with webkit_script_message_reply_return_error_message(). If none of them are called, an automatic reply with an undefined value will be sent.

It is possible to handle the reply asynchronously, by simply calling g_object_ref() on the @reply and returning true.

Since

2.40

Parameters

connectFlags

a combination of ConnectFlags

detail

the signal detail

handler

the Callback to connect. Params: value the value received from the JavaScript world.; reply the #WebKitScriptMessageReply to send the reply to the script message.. Returns true to stop other handlers from being invoked for the event. false to propagate the event further.