Welcome Guest Search | Active Topics | Sign In | Register

EvalScrit -> QueueScriptCall Options
M.Kramer
Posted: Tuesday, October 22, 2019 9:34:56 AM
Rank: Advanced Member
Groups: Member

Joined: 11/3/2015
Posts: 65
Hello,

in the new version you send an exception if the program uses EvalScript.
So I changed it to use QueueScriptCall.

It was some hard work, because I often use it to read data from the browsers frontend.

After I eliminated all EvalScript calls, I still get the message:
EO.WebBrowser.JSInvokeException: EvalScript failed because script engine is not ready or is shutdown before the script can finish. Please use QueueScriptCall instead of EvalScript to execute JavaScript code in this case.

It turns out, that the reason was, that I use:
var String = MyWebControl.WebView.GetDOMWindow().document.body.innerHTML;

So I changed it to
var String = MyWebControl.WebView.GetHtml();

sometime it works, but sometimes it does not work and crashes without any exception.
All I want is to get the HTML Text of the WebView. Is there any other way to get it?

Best regards

Marius
eo_support
Posted: Tuesday, October 22, 2019 11:50:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

This usually occurs when you call it too soon. However GetHtml should always work. If you run into crash, please try to isolate the problem into a test project and send the test project to us. See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
M.Kramer
Posted: Wednesday, October 23, 2019 9:38:11 AM
Rank: Advanced Member
Groups: Member

Joined: 11/3/2015
Posts: 65
Hi,

okay, now I'm waiting for LoadCompleted ... that seems to help.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.