Webview
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, or false on failure |
Examples
local browser = webview.create()
browser:set_message_handler(function(message)
engine.print("info", "Received message:", message)
end)