ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. setBrowserFunction

Function

setBrowserFunction

ClientBrowserTrilogy Hub only

Exposes a Lua function to a local page. In JavaScript you call it with await trilogy.call("name", ...) and get its result.

Syntax

bool setBrowserFunction(browser webBrowser, string name, function fn)

Arguments

webBrowserbrowser
A local browser.
namestring
The name visible in JavaScript.
fnfunction
The Lua function, or nil to remove it.

Returns

true on success.

Example

setBrowserFunction(browser, "getHealth", function()
    return getElementHealth(localPlayer)
end)

See also