Vital.sandbox
Webview

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 browser = webview.create()

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

On this page