|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
|
|
Rank: Newbie Groups: Member
Joined: 4/24/2020 Posts: 7
|
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?
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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?
|
|
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?
|
|
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
|
|