Skip to main content

Webview

Webview tools open, close, and update CEF panels attached near characters.

Webviews are CEF-based browser panels attached near a character. open_webview returns an entity ID used by close_webview and navigate_webview.

open_webview

Open a webview panel displaying HTML content or a URL near the active character.

ParameterTypeDefaultDescription
htmlstringInline HTML content. Mutually exclusive with url.
urlstringURL or MOD asset path. Mutually exclusive with html.
size_xnumber0.7Panel width in world units
size_ynumber0.5Panel height in world units
viewport_widthnumber800Browser viewport width in pixels
viewport_heightnumber600Browser viewport height in pixels
offset_xnumber0Horizontal offset from character center
offset_ynumber0.5Vertical offset from character center (positive = above)

Either html or url is required.

Example — display a styled card above the character:

{
"html": "<html><body style='background:#1e1e2e;color:#cdd6f4;font-family:sans-serif;padding:16px'><h2>Build succeeded</h2></body></html>",
"size_x": 0.8,
"size_y": 0.3
}

close_webview

Close one or all webview panels.

ParameterTypeDefaultDescription
entitynumberEntity ID of the webview to close. If omitted, closes the most recently opened webview.
allbooleanfalseClose all open webviews

Update an existing webview's HTML content without closing and reopening it.

ParameterTypeDefaultDescription
entitynumberWebview entity ID. If omitted, targets the most recently opened webview.
htmlstringrequiredNew inline HTML content to display