Welcome Guest Search | Active Topics | Sign In | Register

Max wait time for LoadUrl Options
Vanik
Posted: Friday, April 24, 2020 11:41:51 AM
Rank: Newbie
Groups: Member

Joined: 4/24/2020
Posts: 7
Hello everyone.
How can I specify the maximum page load timeout for LoadUrl or LoadUrlAndWait?

I use a proxy and I need to specify a specific timeout for a response from the server.

P.S. App in console
eo_support
Posted: Friday, April 24, 2020 4:01:40 PM
Rank: Administration
Groups: Administration

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

You can use LoadUrl(url).WaitOne(time_out):

https://www.essentialobjects.com/doc/eo.base.waitabletask.waitone_overload_1.aspx

Thanks!
Vanik
Posted: Friday, April 24, 2020 4:04:46 PM
Rank: Newbie
Groups: Member

Joined: 4/24/2020
Posts: 7
eo_support wrote:

But WaitOne sets the exact time. But what do I need, for example, when loading a specific element on a page, further loading has been reduced, is it possible to implement this?
eo_support
Posted: Friday, April 24, 2020 4:17:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
I am not exactly sure what you meant by "loading a specific element on a page". The basic rule is anything inside the page is dealt "inside the page" (with JavaScript). For example, if you wish to detect an image inside the page has been loaded then you write JavaScript code inside the page to do that. You can use WebView.EvalScript to run JavaScript in the page and return you the result, but the actual work is still done by JavaScript.
Vanik
Posted: Friday, April 24, 2020 4:21:17 PM
Rank: Newbie
Groups: Member

Joined: 4/24/2020
Posts: 7
eo_support wrote:
I am not exactly sure what you meant by "loading a specific element on a page". The basic rule is anything inside the page is dealt "inside the page" (with JavaScript). For example, if you wish to detect an image inside the page has been loaded then you write JavaScript code inside the page to do that. You can use WebView.EvalScript to run JavaScript in the page and return you the result, but the actual work is still done by JavaScript.

It seems I did not describe the problem that way.
I need LoadUrl to reset the page loading as soon as at least something on the page loads. At least Title
eo_support
Posted: Friday, April 24, 2020 4:44:01 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Our previous reply still applies. Whatever "something" you want to check, it is inside the page. For anything inside the page, you do it with JavaScript.

LoadUrl treats the entire page as a whole. So it can start the load or wait for the end for you for the entire page, it won't do anything in between. For anything in between you need to use JavaScript.
Vanik
Posted: Friday, April 24, 2020 6:07:11 PM
Rank: Newbie
Groups: Member

Joined: 4/24/2020
Posts: 7
eo_support wrote:
Our previous reply still applies. Whatever "something" you want to check, it is inside the page. For anything inside the page, you do it with JavaScript.

LoadUrl treats the entire page as a whole. So it can start the load or wait for the end for you for the entire page, it won't do anything in between. For anything in between you need to use JavaScript.


Understood thanks
Vanik
Posted: Saturday, April 25, 2020 2:37:10 PM
Rank: Newbie
Groups: Member

Joined: 4/24/2020
Posts: 7
Vanik wrote:
eo_support wrote:
Our previous reply still applies. Whatever "something" you want to check, it is inside the page. For anything inside the page, you do it with JavaScript.

LoadUrl treats the entire page as a whole. So it can start the load or wait for the end for you for the entire page, it won't do anything in between. For anything in between you need to use JavaScript.


Understood thanks

Sorry, question.
At what point does webView.Url change the value to Url of the current page?
Judging by what I see, this does not happen immediately after the execution of LoadUrl?
Vanik
Posted: Sunday, April 26, 2020 4:06:48 PM
Rank: Newbie
Groups: Member

Joined: 4/24/2020
Posts: 7
Is it possible to make await for LoadUrl or LoadRequest. What would the program continue only after the execution of all its events and the final execution of the method?
eo_support
Posted: Monday, April 27, 2020 7:31:41 AM
Rank: Administration
Groups: Administration

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

Url changes after load has been "committed". This is not immediately after LoadUrl is called. It can take time for the browser engine to resolve the DNS and make connection to the server.

You can use await however you want, even though you can not use them directly on LoadUrl/LoadRequest because they are not marked as async method. But you should forget about await under the context of your original question. The rule that "anything related to inside the page must be done inside the page" still applies, no matter what syntax you use on the .NET side.

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.