Interface UserContentManager.ScriptMessageWithReplyReceivedCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
UserContentManager
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface UserContentManager.ScriptMessageWithReplyReceivedCallback
extends FunctionPointer
Functional interface declaration of the ScriptMessageWithReplyReceivedCallback callback.
- Since:
- 2.6
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanrun(@Nullable Value value, @Nullable ScriptMessageReply reply) This signal is emitted when JavaScript in a web view callswindow.webkit.messageHandlers., after registering.postMessage() using webkit_user_content_manager_register_script_message_handler_with_reply()default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment)method.default intupcall(MemorySegment sourceUserContentManager, MemorySegment value, MemorySegment reply) Theupcallmethod is called from native code.
-
Method Details
-
run
This signal is emitted when JavaScript in a web view calls
window.webkit.messageHandlers., after registering.postMessage() using webkit_user_content_manager_register_script_message_handler_with_reply()The given
replycan 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
replyand returningtrue.- Since:
- 2.40
-
upcall
default int upcall(MemorySegment sourceUserContentManager, MemorySegment value, MemorySegment reply) Theupcallmethod is called from native code. The parameters are marshaled andrun(Value, ScriptMessageReply)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-