Welcome Guest Search | Active Topics | Sign In | Register

WebView.AfterRecieveHeaders Event does not have same behavior Options
Jessica_Suarez
Posted: Tuesday, August 13, 2019 9:53:53 AM
Rank: Newbie
Groups: Member

Joined: 8/13/2019
Posts: 3
Hello guys,

We recently changed the dlls EO.Base, EO.WebBrowser, EO.WebBrowser.wpf, EO.WebEngine from v18.2.53 to v19.1.40.
The WebView.AfterReceiveHeaders has not the same behavior in my project comparing both versions.

There are something different on this event? or another one that complement it in new versions?


What I am trying to execute is the following code:

While page is loading, the events are working fine...

But in the last when my url changes and the flag for ProcessingComplete changes to true, last call for to check the WebView_AfterReceiveHeaders() is never invoked to validate the my ProcessingComplete flag and trigger the ExecuteCallBack();



Quote:
private void WebView_BeforeNavigate(object sender, BeforeNavigateEventArgs e)
{
if (e.NewUrl.EndsWith(@"OperationSuccess/", StringComparison.OrdinalIgnoreCase))
{
ProcessingComplete = true;
}

}



Quote:
private void WebView_AfterReceiveHeaders(object sender, ResponseEventArgs e)
{
if (this.ProcessingComplete)
{
this.DialogResult = DialogResult.OK;
ExecuteCallBack();
}
}



It works on v18.2.53 but not in v19.1.40.


Thanks in advance for your help.

Jessica
eo_support
Posted: Wednesday, August 21, 2019 3:57:45 PM
Rank: Administration
Groups: Administration

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

You can not use BeforeNavigate and AfterReceiveHeader this way. These are two problems:

1. They are NOT one to one. BeforeNavigate is only triggered for the main resource, where as AfterReceiveHeader is triggered for every resources. So if you have a page index.html that contains an img element, the BeforeNavigate will be triggered for index.html, but AfterReceiveHeader will be triggered for both index.html and the image Url. To avoid this problem, you can check e.Request.ResourceType in your AfterReceiveHeader handler;

2. They are called in different threads. So you must add synchronization code between these two handlers;

Hope this helps.

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.