Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6e

Application v 6.3a

  

 

Chapter Twenty-oneWebView Interface

21.2 JavaScript Interface

21.2.1 Overview

The JavaScript Interface object represents a running JavaScript instance. Currently the JavaScript Interface only uses the WebView Object as the JavaScript Engine. This means any JavaScript code executed must be compatible with the Microsoft Edge browser JavaScript Engine.

JavaScript is presently released as a capabilities preview. API functions and features are subject to change.

21.2.2 Asynchronous Scripts

JavaScripts can be run asynchronously through Legato. Because of this developers should ensure they allow the WebView object time to process the JavaScript (and any user input for the JavaScript).

21.2.3 JavaScript Side Scripting

A JavaScript program can be injected into the current WebView, interact with the DOM and return data back to Legato. A handle is returned for a JavaScript Object that can then be used to check the status of the script and retrieve data from the script.

21.2.4 JavaScript Messaging

Messages can be sent from JavaScript to Legato through the JavaScriptSetMessageHandler function. Because these messages are posted from JavaScript, responses are not possible. Instead, when a message is received developers can run additional JavaScript code if needed. Please see the documentation for JavaScript interaction with the WebView2 control from Microsoft for more information on posting messages.

21.2.5 Functions

Page revised 2025-10-20