Welcome Guest Search | Active Topics | Sign In | Register

webView1.StopLoad() not working as expected Options
Louis
Posted: Monday, February 5, 2024 2:43:59 AM
Rank: Advanced Member
Groups: Member

Joined: 6/20/2016
Posts: 32
I am loading a URL in a webview like so:

webView1.LoadUrl(strURL).WaitOne(60000)

Some of the pages I visit take a long time to finish loading, which is why I have the 60 second timeout.

I noticed that if I call webView1.StopLoad(), then the LoadUrl statement above will continue executing until the 60 second timeout has been reached, and only then will it resume to the next line in my code.

Is there a way to break out of that LoadUrl statement immediately?
eo_support
Posted: Monday, February 5, 2024 2:11:29 PM
Rank: Administration
Groups: Administration

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

We have looked into this and indeed found a problem with StopLoad. This will be fixed in our next build. However regardless you can not use StopLoad to break WaitOne. This is because all commands to the browser engine are sent in a single sequence, so one won't be sent (and processed) until the other one is done. This means the StopLoad command will not be processed until WaitOne returns.

If you must trigger some action after the load has been stopped, you can do it this way:

Code: C#
webView1.LoadUrl(strURL).OnDone(()=>
{
     //do something after the task has completed or been canceled
});


Note that even this code will have problem in the following sequence one after another immediately:

1. Create the new WebView;
2. LoadUrl;
3. StopLoad;

This is the issue that we have found and will be fixed in our next build. In a "normal" scenario such as the following it would work OK:

1. Application starts, UI initialize and WebView is created;
2. User enters a Url or press a button to load the Url;
3. User press another button to call StopLoad;

We will reply here again once a new build with the fix is posted.

Thanks!
Louis
Posted: Tuesday, February 6, 2024 12:35:17 PM
Rank: Advanced Member
Groups: Member

Joined: 6/20/2016
Posts: 32
Great response, thank you!
eo_support
Posted: Tuesday, February 6, 2024 12:46:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
You are very welcome. Please feel free to let us know if there is anything else.
eo_support
Posted: Friday, March 1, 2024 10:28:30 AM
Rank: Administration
Groups: Administration

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

This is just to let you know that we have posted build 24.0.49 that should resovle this issue. You can download the new build from our download page. Please take a look and let us know how it goes.

Thanks!
Louis
Posted: Thursday, March 7, 2024 1:35:30 PM
Rank: Advanced Member
Groups: Member

Joined: 6/20/2016
Posts: 32
It's working well, thank you very much!
eo_support
Posted: Friday, March 8, 2024 12:48:14 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Great. Thanks for confirming!


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.