|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi,
I am evaluating the EO WebBrowser for our product. I want to apply the spinner while page is loading, should start on initiating the request and finish when the page is completely loaded.
Can you please help on this, which events I can use for that?
Regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, There are several different ways to do that. The easiest way is to use LoadUrlAsync. The code will be something like this:
Code: C#
//Reference EO.Extensions.dll and import namespace
//EO.Extensions is needed to use WebView.LoadUrlAsync
using EO.Extensions;
async void LoadUrl(WebView webView, string url)
{
//Display the spinner
ShowSpinner();
try
{
//Load the url and wait for it to finish
await webView.LoadUrlAsync(url);
}
finally
{
//Hide the spinner
HideSpinner();
}
}
Note that this uses async feature provided by .NET and it requires .NET Framework 4.6 or newer. You would also need to reference EO.Extension.dll in order to use LoadUrlAsync. If you can not use async feature due to your project is based on older .NET Framework, then you would need to handle both LoadCompleted event and LoadFailed event. Please feel free to let us know if you still have any more questions. Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi,
Thank you so much for your quick response. You answered my query, and it is working fine.
I have one more query, that is, I want to disable the browser context menu. The reason is we have our own context menu and we do not want to display the default browser context menu. Can you please assist on this?
Thanks.
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi,
Today morning I tried the shared example of loading spinner with 22.1.94.0 version, and it was working fine.
Now I downloaded the latest Nuget pkg 23.1.21.0, but it is not loading the page. Can you please help on this?
One observation: Version 22.1.94.0 does not required EO.Extension whereas the latest version requires it.
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Please always use the latest version.
As to context menu, you can handle WebView.BeforeContextMenu event and call e.Menu.Items.Clear() in your event handler. You can check the source code in MainWindow.xaml.cs inside TabbedBrowser sample application source code for example of handling this event.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi, I am using the latest version only (Nuget pkg 23.1.21.0), but await webView.LoadUrlAsync(url); is not working. I have included the reference of EO.Extensions also. Can you please help on this?
Code: C#
using EO.Extensions;
async void LoadUrl(WebView webView, string url)
{
//Display the spinner
this.ShowProgressBar();
try
{
//Load the url and wait for it to finish
await webView.LoadUrlAsync(url); // The response is not coming from this API
}
finally
{
//Hide the spinner
this.HideProgressBar();
}
}
The same code was working in previous version. Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Can you try to isolate the problem into a test project and then send the test project to us? See here for instructions: https://www.essentialobjects.com/forum/test_project.aspxThanks
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi,
I have shared the sample project, can you please check that?
Regards,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
We ran your test project here and it successfully loaded Google's home page when you click the button. What problem do you have?
Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi, For me it is not loading the page. And there is response after the below statement:
Code: C#
await webView.LoadUrlAsync(url);
If I use
then it works fine. But this will not load the spinner.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
The code you sent to us does not have any code to load the spinner and when we run it it loads the page successfully. In order for us to investigate further we must have a sample project that can reproduce the problem first.
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi,
No need of spinner, without that also it is not working.
I crossed checked again and found that, on Form load it is not working, if I click on Go button then it is working.
So in my case I need to make it work on Form load itself. Can you please check whether the page is loading on Form load for you?
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Mohammed Ayyub wrote:I crossed checked again and found that, on Form load it is not working, if I click on Go button then it is working. This is exactly why we ask you to send a test project to reproduce the problem. You can't just send us a test project that does one thing and then tell us by the way the problem occurs when you do something else. This is a waste of time for both of us. Please resubmit a test project that can demonstrate the problem as well as detailed step by step instruction on how to reproduce the problem and we will investigate further.
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi,
Got it. I have sent the modified project where the actual issue is happening.
Steps to reproduce: You need to just run the project, on load Google page should be loaded, but it is not loading.
Regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
We have received the new test project and confirmed this to be an issue in our library. This issue will be fixed in our next build.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/8/2023 Posts: 14
|
Hi,
Thanks for the update. Can you please let us know when the next build will be available?
Regards,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Yes. We will reply here again when the new build is available.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
This is just to let you know that we have posted build 23.1.45 that should resolve this issue. You can download the new build from our download page. Please take a look and let us know how it goes.
Thanks!
|
|