Hi,
You did not do anything wrong. This is a known restriction introduced in newer builds. Newer version of EO.WebBrowser no longer allow you to make synchronously JavaScript calls when you are already inside a JavaScript callback (inside JSExtInvoke handler). Allowing so would cause JavaScript engine to be re-entered, which is not allowed by design by the JavaScript engine.
The following demonstrates the danger of re-entering. Assuming JavaScript code as:
Code: JavaScript
var i = 0;
eoapi.extInvoke("something");
if (i != 0)
alert("How did 'i' change?");
Code: Visual Basic.NET
Private Sub WebView1_JSExtInvoke(sender As Object, e As JSExtInvokeArgs)
WebView1.EvalScript("i = 1;")
End Sub
The above code if allowed would display "How did 'i' change?" message. This is not logical from JavaScript code writer point of view. In reality re-entering can cause far more damage --- it can corrupt JavaScript engine's internal runtime data as the engine is not designed to allow re-entering.
The solution to this issue is to call your code asynchronously. You can either do it with WebView.QueueScriptCall, or you can use a feature related to your platform. For example, if you use Windows.Forms, you can use Control.BeginInvoke to delay the call.
Please feel free to let us know if you have any more question.
Thanks!