Create a new WebUi
@eryx/webui Module
WebUi is a simple wrapper on top of webview that provides utilities for message passing and event binding.
local ui = webui.new("IPC Demo")
ui.win:navigateToString(fs.open("web.html")):read())
ui.win:show()
ui:on("chat"):connect(function(data)
ui:post("chat", { message = `Echo: {data.message}` })
end)
ui:onJsEvent("#clickme", "click"):connect(function()
print("Button clicked")
end)
Summary
Exported Class
API Reference
Exported Class
WebUi
Properties
The WebView window
WebUi:onJsEvent
Bind to a JavaScript event
Parameters
CSS element selector, such as "#foo"
JavaScript event, such as "click"
Returns
A signal that fires every time the event occurs
WebUi:on
Bind to an eryx.post event
Parameters
The event to bind to
Returns
A signal that fires every time the event is posted