Hi,
Please see https://www.appeon.com/standardsupport/search/view?id=8663 and https://www.appeon.com/standardsupport/search/view?id=7803
The EvaluateJavascript(Async)() functions aren't that stable in my opinion. What is always successful, is to NOT use dynamic JS, but simply call a JS function that you have in your HTML. In your case though, that might not be an easy solution.
I found that having some specific code in the Open() event of the application object improved things significantly:
Do you have a similar code like this (see code block below) in the Open event of your application object?
(w_wbrowser_dummy is a small invisible window that prevents a bug of the application blowing up on windows server 2012, when exiting the application.)
I haven't tried it myself, but this could be an alternative for the webbrowser control. (also based on the chrome engine):
https://community.appeon.com/index.php/qna/q-a/save-pdf-from-webbrowser-control-header-footer/oldest
https://drive.google.com/file/d/1BLuFYKJl00-okqM3LHFHJB60jPUfFub8/view
-------------------------
// v3, mjl, 18/06/21: seems to be a necessary setting for CEF webbrowser control:
int li_ret
string ls_ret
li_ret = WebBrowserGet("UserAgent", ref ls_ret)
if ls_ret = "" then
li_ret = WebBrowserSet("UserAgent", "AppeonWebBrowser")
if li_ret <> 1 then
Messagebox("Information", "Error setting the UserAgent for the WebBrowser", information!)
end if
end if
// v4, mjl, 05/07/21: avoid an existing Appeon bug of blowing up when using the webbrowser control on Windows Server 2012 R2:
open(w_wbrowser_dummy)
close(w_wbrowser_dummy)
string ls_docFolder
n_filesys lnf
ls_docFolder = lnf.of_getfolderpath(CSIDL_PERSONAL)
li_ret = WebBrowserSet("DownloadPath", ls_docFolder)
if li_ret <> 1 then
Messagebox("Information", "Error setting the DownloadPath for the WebBrowser", information!)
end if
li_ret = WebBrowserSet("allow-file-access-from-files", "true")
if li_ret <> 1 then
Messagebox("Information", "Error setting the FileAccess for the WebBrowser", information!)
end if
Hope you figure it out.
As a last idea, you could define the JS as a function within the HTML files. Since your html is dynamic, you would have to edit that html from code, which is more of a pain and then also you would have your JS exposed to anyone who can read the files, so not as good as your initial approach.