Welcome Guest Search | Active Topics | Sign In | Register

Detect WebView Loaded complete after submit Options
AdrianM
Posted: Monday, February 23, 2015 7:54:10 AM
Rank: Newbie
Groups: Member

Joined: 2/19/2015
Posts: 3
Hi all,

I'm testing the EO.WebBrowser dll. I'm loading a Web and when the webView_LoadedComplete event is fired I'm use the EvalScript function to click on a submit button. Is it posible to detect when the new HTML document is loaded complete to execute again another EvalScript function?

Thank you in advance.

Best regards.
eo_support
Posted: Monday, February 23, 2015 11:12:45 AM
Rank: Administration
Groups: Administration

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

You can use QueueScriptCall from inside LoadComplete event. That way the script will run as soon as your event handler finishes.

Thanks!
AdrianM
Posted: Friday, March 6, 2015 3:55:51 AM
Rank: Newbie
Groups: Member

Joined: 2/19/2015
Posts: 3
Hi,

Thank you for your reply. I have tried to use QueueScriptCall but it didn´t work. This is an example what I want to do:

1. Go to www.myWeb.com (webView1.Url = "www.myWeb.com")

String script1 = "document.getElementsByTag('a')[0].click();";
String script2 = "alert(document.title)";

2. On event webView1_LoadCompleted:
webView1.QueueScriptCall (script1);
webView1.QueueScriptCall (script2);

How can I get the title of the 2nd document after the event click? Thank you in advance.



eo_support
Posted: Friday, March 6, 2015 8:29:34 AM
Rank: Administration
Groups: Administration

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

I am not sure if I understood your question correctly. Have you checked whether LoadComplete event is fired? LoadComplete event will be fired for each LoadUrl/LoadRequest call.

If your original Url is not loaded with LoadUrl/LoadRequest, then LoadComplete event will not be fired. In that case you can try to Set WebView.JSInitCode to something like this:

Code: JavaScript
window.onload = function() 
{ 
    setTimeout(function()
    {
        action_here
    }, 100);
}


WebView.JSInitCode is run everytime a new document is created (not loaded). So inside JSInitCode you can hook up to window.onload event and then trigger additional script code from there.

Hope this helps. Please feel free to let us know if you still have any questions.

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.