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 Details

    • run

      boolean run(@Nullable Value value, @Nullable ScriptMessageReply reply)

      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
    • upcall

      default int upcall(MemorySegment sourceUserContentManager, MemorySegment value, MemorySegment reply)
      The upcall method is called from native code. The parameters are marshaled and run(Value, ScriptMessageReply) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer