WebUI.Page

Runs inside the game process. Reads and presentation are local; anything that changes shared state has to go through the server.

client runtime9 functionsMarkdown

destroy

SHARED

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.

Returns

  • boolean

Registered in ResourceHost.cpp as LuaWebPageDestroy (line 6472).

hide

SHARED

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().

Returns

  • boolean

Registered in ResourceHost.cpp as LuaWebPageVisibility (line 6474).

id

SHARED

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.

Returns

  • integer

Registered in ResourceHost.cpp as LuaWebPageId (line 6471).

off

SHARED

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

Returns

  • boolean

Registered in ResourceHost.cpp as LuaWebPageOff (line 6478).

on

SHARED

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

Returns

  • handler id

Registered in ResourceHost.cpp as LuaWebPageOn (line 6477).

reply

SHARED

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

Returns

  • boolean

Registered in ResourceHost.cpp as LuaWebPageReply (line 6479).

send

SHARED

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

Returns

  • boolean

Registered in ResourceHost.cpp as LuaWebPageSend (line 6476).

setFocus

SHARED

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

Returns

  • boolean

Registered in ResourceHost.cpp as LuaWebPageFocus (line 6475).

show

SHARED

WebUI.Page.show()

Shows the surface.

Avoid calling this right after create — see the race described in CyberM.webui.create.

Returns

  • boolean

Registered in ResourceHost.cpp as LuaWebPageVisibility (line 6473).

For agents and LLMs: this page as Markdown · llms.txt · llms-full.txt