|
Rank: Member Groups: Member
Joined: 9/3/2013 Posts: 16
|
Hello, We are testing EO.WebBrowser and is a great component. But we detect some issues, maybe you could help us or maybe it's a fix that you need to code. - Last version (2013.0.72) Im adding a WebBrowser to a WinForm. When I set the "Dock" Property to "Fill" it fills the winforms leaving a 1px or 2px border. If I change the DLL to the previous version, it fill the winform properly. - When I navigate to a new URL, how can I detect the "StatusCode" when the URL loads? Fractus - Developer & Consulting
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Thanks for letting us know. We are not aware of the border issues. We will look into it and let you know. The HTTP status code is available through this propery: http://www.essentialobjects.com/doc/6/eo.webbrowser.navigationtask.httpstatuscode.aspxFor example, you can do:
Code: C#
//Load the Url
NavigationTask task = WebView1.LoadUrl("http://www.google.com");
//Wait for the load to finish
task.WaitOne();
//Now you can get the status code
int statusCode = task.HttpStatusCode;
Instead of calling WaitOne(), you can also handle the WebView's LoadComplete. The event argument of that event also provides the NavigationTask object that has just finished loading. Hope this helps. Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/3/2013 Posts: 16
|
Thanks for the help, I'll be waiting for the update of the dock property. Fractus - Developer & Consulting
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We have posted a new build. Please try that build instead. We have not been able to reproduce the docking issue both in the old build and new build though. If you continue to have problem with the new build, please post a picture (you will have to post the picture somewhere else and provide a link) so that we can see the problem.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/3/2013 Posts: 16
|
Hello, I'm attaching a screenshot and a demo project replicating the issue of the border. Hope this helps. ScreenshotProject Fractus - Developer & Consulting
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Thanks for the test project. We have confirmed this to be an issue. We will fix this in our next build.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We have posted a new build that should fix this issue. You can download the new build from our download page.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/3/2013 Posts: 16
|
Hello, It's working perfectly, thanks guys. Another question... We are using the event "LoadComplete", it's fires the event after the page loads. But when we click on a href on the page, the "LoadComplete" event doesn't fire again. What we are doing wrong? or how can we achieve this? Best Regards! PD: We will acquire this component, it's really good. Fractus - Developer & Consulting
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Glad to hear that it's working for you and you will acquire the component!
The LoadComplete event is only used to track one of the LoadXXX calls issued by you. For example, when you call LoadUrl, you will get a NavigationTask object. You have two options to detect when this NavigationTask object finishes load. One way is to call NavigationTask.WaitOne to wait. Another option is to handle LoadComplete event. The event argument of the LoadComplete event will pass you the same NavigationTask object associated to the original LoadUrl call. Because a unique NavigationTask object is associated to each LoadXXX call, LoadComplete event (and LoadFailed event) is very accurate. For example, if you issue LoadUrl a load Url call to load a page, but that page contains JavaScript code to redirect to another page (assume the JavaScript code is included directly in the page so the code runs before the page finishes loading), then when the redirect happens, a LoadFailed event will be fired. In this case you can know for sure that the page loaded is not the original page your code requested since a LoadFailed, not LoadComplete event is fired for your NavigationTask object.
When you click on href on a page, the load was not initiated by you so no NavigationTask object was created to track the the progress. As such no LoadComplete/LoadFailed will be fired. In this case you can use IsLoading and IsLoadingChanged event to monitor whether the WebView is still loading the page. The disadvantage of IsLoading/IsLoadingChanged is that it can't be used to precisely distinguish which page has been loaded. For the same example above, you will see IsLoading changed to false after the redirected page is loaded. However there is no way for you to tell that the WebView has actually loaded a different page just by IsLoading alone. This is when LoadComplete/LoadFailed event is useful.
When user clicks a href, BeforeNavigation event will be fired. We are thinking about providing a way to associate a NavigationTask event to the new request inside this event handler. Once that is implemented, you will have the option to track such load request too.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 5/8/2015 Posts: 46
|
Hi,
How would we go about capturing and dealing with a failed navigation when that navigation was triggered by a user (i.e. clicking from one page on a site to another that doesn't exist) as this won't fire a LoadFailed or LoadComplete event?
I've looked at the IsLoadingChanged and this fires when user-initiated navigation fails but there's nothing I can see to differentiate failure from success?
Regards, Andy.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
There is no way to do that in the current build. We have a new build that is currently going through test will fire LoadCompleted/LoadFailed events for all navigations, including both those initiated by your code and those initiated from the user. That build will be out very soon.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 10/6/2015 Posts: 1
|
Hi,
Do you have any news about this feature?
Regards, Oscar.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Oscar wrote:Hi,
Do you have any news about this feature?
Regards, Oscar. Hi, This is already implemented in the current build. Thanks!
|
|