Skip to main content

web

The page a browser build runs in. Facts about it are read once per tick and recorded, so a replay answers as the browser did; a message from the parent frame reaches on_web_message on every node that called listen. Off the web every query answers nil.

7 functions, 0 constants. Scripts reach it as web::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

functionacts onwhat it does
hardware_concurrency() -> anyHow many threads the browser reports, or nil off the web.
listen(node, any?)Have the node's on_web_message(payload) — or the on_event method the options name — called for every message the parent frame posts.
location() -> anyThe page's URL, or nil off the web.
messages() -> anyEvery message the parent frame posted this tick, for a script that would rather ask than declare a method.
post_message(any) -> boolPost a value to the page that embeds this one. False off the web, and false while a recording plays.
user_agent() -> anyThe browser's user agent string, or nil off the web.
visible() -> boolWhether the tab is in front of the player; true off the web.