Welcome Guest Search | Active Topics | Sign In | Register

Load Failed when using HTTP proxy Options
Peavy
Posted: Tuesday, October 17, 2017 1:43:07 PM
Rank: Advanced Member
Groups: Member

Joined: 6/26/2015
Posts: 98
Hello,

We're having an issue on the latest update of EO. We are using a Squid proxy with authentication for the browser and sometimes the LoadFailed event is fired when using the Back or Forward navigations. The page still seems to load successfully. We see this error occur on sites like cnn.com and nytimes.com.

Thanks!
eo_support
Posted: Tuesday, October 17, 2017 4:46:02 PM
Rank: Administration
Groups: Administration

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

Is there any way you can create a test project and provide the proxy access to us so that we can reproduce the problem? Once we reproduce it here we will be able to debug into the browser engine's source code to find out the root cause.

Thanks!
Peavy
Posted: Friday, November 10, 2017 3:47:54 PM
Rank: Advanced Member
Groups: Member

Joined: 6/26/2015
Posts: 98
Hello,

Sorry for the long delay. We were able to reproduce the issue without the use of a proxy. It looks like as long as you handle the LoadFailed event on the WebView, whenever you try to navigate to a different page (change the URL, use back or forward buttons) and the current page is still loading, including dynamic elements. We have always handled the LoadFailed event and only this happening in the recent releases. I have sent the test project to your support email.

Thanks
eo_support
Posted: Tuesday, November 14, 2017 10:50:22 AM
Rank: Administration
Groups: Administration

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

We have looked into your test project. It is normal for LoadFailed to be fired in such cases.

The flow of events is as follow:

1. When the WebView starts to load a page, either directly through a direct API call (such as LoadUrl/LoadHtml/GoBack/GoForward) or indirectly through user action (such as user clicks a link), a new NavigationTask object is created;
2. The WebView starts loading this task. It will eventually reaches one of the two states: completed or failed. "Completed" means the entire main document has been fully received and loaded;
3. If the task ended before the "Completed" state, it is considered to have failed. This doesn't mean the task is an entire failure ---- the WebView could have already loaded 90% of your page and the user didn't want to wait for the last 10% and navigated to somewhere else. In this case the LoadFailed event will be fired (usually with ErrorCode as "Canceled"). This appears to be your case. In this case visually the page has been loaded fine since the vast majority of the contents of the page has already been loaded and displayed;

The fact that you did not observe this issue in the old version could be a coincident --- such as some subtle timing change on the network. But it is perfectly normal for LoadFailed event to fire in such cases.

Having that said, there are two different cases for LoadFailed event that would require it to be handled differently:

A: When the task is the last task (for example, you type an invalid address in the address bar and the page failed to load);
B: When the task is not the last task (for example, when you navigate to another page before the first page finishes loading, in this case LoadFailed event will be fired for the first load request);

The difference between these is for case A it should display an error message and for case B it should not. We do so internally but there is no way for you to tell which case it is in your LoadFailed event handler. We will see if we can add a property to the LoadFailedEventArgs so that you can tell which case it is. This way you can decide whether you should show an error message to the user.

Thanks!

eo_support
Posted: Friday, December 1, 2017 8:27:27 AM
Rank: Administration
Groups: Administration

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

This is just to let you know that we have posted a new build that added this property:

https://www.essentialobjects.com/doc/eo.webbrowser.loadfailedeventargs.shouldshowerror.aspx

This property is automatically set to true or false before your event handler is called. However you can override it in your LoadFailed event handler.

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.