![]() ![]() |
GoFiler Legato Script Reference
Legato v 1.6e Application v 6.3a
|
| Table of Contents | < < Previous | Next >> |
Chapter Twenty-one — WebView Interface (continued)
Overview
The JavaScriptRun function injects JavaScript into a WebView and returns a JavaScript Object handle.
Syntax/Parameters
Syntax
handle = JavaScriptRun ( handle hWVO, string code | wstring code, [boolean wait] );
Parameters
hWVO
A handle specifying a WebView Object.
code
A string or wstring specifying JavaScript code to execute.
wait
An optional boolean flag specifying whether to wait for the JavaScript to complete. The default value is FALSE.
Return Value
On success, a handle specifying a JavaScript Object or NULL_HANDLE on failure. Use the IsError or GetLastError function to determine if an error occurred and the nature of the error.
Remarks
The JavaScript code is injected into the WebView and executed immediately. The injected code can interact with the DOM but is subject to the active page’s content security policy. Because of this is, it is not recommended to write a script that injects more JavaScript on to the page unless the site actively allows such.
The WebView object can inject JavaScript before the page is finished loading so developers should design their script to handle cases where the DOM may be in flux. Any data returned by the JavaScript code can be retrieved using the JavaScriptGetJSON or JavaScriptGetRaw functions. If the script throws a JavaScript exception the returned value will be “null”.
If the wait parameter is set to true the Legato script will block until the JavaScript is completed. Using this option while inside a callback may result in a deadlock. Developers can use the JavaScriptIsComplete function to test if the script has completely executed including any JavaScript promises. Any events added by the script will continue to be in effect unless removed by other scripts.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Page revised 2025-10-20
| Table of Contents | < < Previous | Next >> |
© 2012-2025 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission is prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. Novaworks, GoFiler™ and Legato™ are registered trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are the property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.