WebUI.Page.destroy()
Destroys the surface.
Destroys this resource-owned browser surface, removes all of its Lua event handlers and invalidates the page handle. Resource teardown performs the same cleanup automatically.
Registered in ResourceHost.cpp as LuaWebPageDestroy (line 6472).
WebUI.Page.hide()
Hides the surface.
Makes the owned browser surface invisible without destroying its document or handlers. Visibility is client-local and can be restored with show().
Registered in ResourceHost.cpp as LuaWebPageVisibility (line 6474).
WebUI.Page.id()
Numeric id of the surface.
Returns the opaque client-local surface id for diagnostics and host integration. It is not a network id and must not be persisted across page destruction or resource reload.
Registered in ResourceHost.cpp as LuaWebPageId (line 6471).
WebUI.Page.off(event, handler)
Removes a handler registered with on.
Removes one WebUI callback id previously returned by page:on. The id must belong to this page and the current resource generation.
Parameters
- eventstringrequired
- handlerfunctionrequired
Registered in ResourceHost.cpp as LuaWebPageOff (line 6478).
WebUI.Page.on(event, handler)
Listens for an event the page raised with CyberM.emit.
Registers a Lua callback for an event emitted by this page's JavaScript bridge. Event names and handler counts are bounded, and the registration is automatically removed with the page or resource generation.
Parameters
- eventstringrequired
- handlerfunctionrequired
Registered in ResourceHost.cpp as LuaWebPageOn (line 6477).
WebUI.Page.reply(request, ok, [payload])
Answers an invoke call made by the page.
Completes a pending JavaScript request identified by its request id with a JSON-serializable Lua value. Request ids are page-local and invalid or unsupported payloads are rejected.
Parameters
- requestintegerrequired
- okbooleanrequired
- payloadtableoptional
Registered in ResourceHost.cpp as LuaWebPageReply (line 6479).
WebUI.Page.send(event, [payload])
Sends an event to the page.
Sends a named event and JSON-serializable payload from Lua to this page's JavaScript runtime. This is local UI IPC, not a network event, and both event names and payloads are bounded.
Parameters
- eventstringrequired
- payloadtableoptional
Registered in ResourceHost.cpp as LuaWebPageSend (line 6476).
WebUI.Page.setFocus(focused, [cursor], [keyboard])
Gives the surface focus, cursor and keyboard separately.
Keyboard capture is asked for separately so a page can take the mouse without depriving the game of the movement keys.
Parameters
- focusedbooleanrequired
- cursorbooleanoptional
- keyboardbooleanoptional
Registered in ResourceHost.cpp as LuaWebPageFocus (line 6475).
WebUI.Page.show()
Shows the surface.
Avoid calling this right after create — see the race described in CyberM.webui.create.
Registered in ResourceHost.cpp as LuaWebPageVisibility (line 6473).