Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser.JSInvokeException Options
Galloden
Posted: Friday, April 1, 2016 8:50:16 PM
Rank: Newbie
Groups: Member

Joined: 4/7/2015
Posts: 8
Hi, first off great job on the support and constant releases!

I am encountering an interesting issue, I have some code that looks like this...

if (wb.WebView.CanEvalScript)
{
wb.WebView.EvalScript("document.activeElement.focus()");
}

this is the only place where I call EvalScript in this scenerio.

However sometimes (maybe 5% of the time) I get a popup that gives me this error:

" It is not safe to run JavaScript code at this moment. This can occur if you are inside event handlers of certain WebView events. In that case please check CanEvalScript property before calling EvalScript. "

The strange part is, I AM checking this CanEvalScript property, however still seldomly I will get an EO runtime exception popup stating the above error.

Is there anything else I can do to get around this runtime exception? Also is there a way to suppress the runtime exception popups? (I will still realize the issue is there however I dont want to constantly see the dialogs)

Thanks!
Galloden
eo_support
Posted: Friday, April 1, 2016 9:32:43 PM
Rank: Administration
Groups: Administration

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

Please use WebView.QueueScriptCall instead.

Thanks!


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.