UserContentManager.connectScriptMessageWithReplyReceived
gulong connectScriptMessageWithReplyReceived(T)(string detail = null, T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : javascriptcore.value.Value)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == webkit.script_message_reply.ScriptMessageReply)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : webkit.user_content_manager.UserContentManager)))
&& Parameters!T.length < 4)Connect to ScriptMessageWithReplyReceived signal.
This signal is emitted when JavaScript in a web view calls
window.webkit.messageHandlers.<name>.postMessage(), after registering
<name> using
[webkit.user_content_manager.UserContentManager.registerScriptMessageHandlerWithReply]
The given reply can be used to send a return value with [webkit.script_message_reply.ScriptMessageReply.returnValue] or an error message with [webkit.script_message_reply.ScriptMessageReply.returnErrorMessage]. 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 [gobject.object.ObjectWrap.ref_] on the reply and returning true.
Parameters
detail | Signal detail or null (default) |
callback | signal callback delegate or function to connect bool callback(javascriptcore.value.Value value, webkit.script_message_reply.ScriptMessageReply reply, webkit.user_content_manager.UserContentManager userContentManager) value the value received from the JavaScript world. (optional) reply the #WebKitScriptMessageReply to send the reply to the script message. (optional) userContentManager the instance the signal is connected to (optional) Returns true to stop other handlers from being invoked for the event. false to propagate the event further. |
after | Yes.After to execute callback after default handler, No.After to execute before (default) |
Returns
Signal ID