webview:message
Client
Fired when a webview receives an IPC message from its page
Signal
"webview:message"Arguments
| Type | Name | Description |
|---|---|---|
userdata | webview | The webview instance that received the message |
string | message | The raw message string sent from the page |
This is the primary IPC channel between a webview page and Lua.
- Messages are sent from the page via
window.ipc.postMessage(message). - The message is a raw string — parse it as JSON if structured data is needed.
Example
util.event.on("webview:message", function(webview, message)
core.engine.print("info", "Webview message:", message)
end)util.event.on("webview:message", function(webview, message)
local data = util.table.decode(message)
if data and data.action == "ready" then
core.engine.print("info", "Page is ready")
end
end)