Skip to content

Search

Documentation

browser module

The page a browser build runs in; off the web every query answers nil. A parent-frame message reaches on_browser_event on every node that called listen.

На цій сторінці

The page a browser build runs in; off the web every query answers nil. A parent-frame message reaches on_browser_event on every node that called listen.

8 functions, 0 constants. Scripts reach it as browser::.

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.

function acts on what it does
hardware_concurrency() -> any — How many threads the browser reports, or nil off the web.
listen(node, any?) — Have the node's on_browser_event(payload), or the on_event method the options name, called for every message the parent frame posts.
location() -> any — The page's URL, or nil off the web.
messages() -> any — Every message the parent frame posted this tick, for a script that would rather ask than declare a method.
post_message(any) -> bool — Post a value to the page that embeds this one. False off the web, and false while a recording plays.
stop_listening(node) — Stop the node hearing the parent frame's messages. Not an error when it never listened.
user_agent() -> any — The browser's user agent string, or nil off the web.
visible() -> bool — Whether the tab is in front of the player; true off the web.