self:set_message_handler
Client
Registers a handler function to receive messages posted from the webview
Syntax
local status = self:set_message_handler(
handler
)Parameters
| Type | Name | Description |
|---|---|---|
function | handler | Callback function invoked when the webview posts a message via window.ipc.postMessage() |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.webview.create()
entity:set_message_handler(function(message)
core.engine.print("info", "Received message:", message)
end)