self:emit

Client

Posts a message from Lua to the webview's JavaScript context


Syntax

local status = self:emit(
    input
)

Parameters

TypeNameDescription
stringinputMessage string to post to the webview

Returns

TypeNameDescription
boolstatustrue on successful execution, or false on failure

Examples

Send a message from Lua to the webview
local wv = webview.create()

-- Send a JSON payload to the webview
wv:emit('{"event":"ready","data":{"user":"aviril"}}')

On this page