Welcome Guest Search | Active Topics | Sign In | Register

WebView on TabControl doesn't load webpage Options
Roy
Posted: Tuesday, July 14, 2020 7:43:31 AM
Rank: Newbie
Groups: Member

Joined: 7/14/2020
Posts: 3
I am trying to debug a situation with a WebView located in a TabControl. When the application is first started, and I navigate to the tab with the WebView, the page that it is supposed to load, isn't loaded. The only thing I see is a white screen. The application allows a user to logout & login. After a logout & a login, I can navigate to the tab again and the page is loaded perfectly fine.

My question is then as follows:
Which properties on the WebView do I need to investigate to see when it is ready to load a page? I've looked at IsInitialized, IsLoaded, IsVisible, IsReady & IsSealed. I already eliminated IsSealed since the WebView isn't read-only. I can safely tick off IsVisible & IsLoaded, but I can't figure out when IsReady is set, and if that is even what I should be looking at.
eo_support
Posted: Tuesday, July 14, 2020 11:50:36 AM
Rank: Administration
Groups: Administration

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

You do not have to worry about whether the WebView is ready to load a page. You can set its Url property BEFORE it is ready to load. In that case as soon as it is fully initialized it will start to load the page.

When you see a complete blank page, there are several possibilities:

1. The WebControl has not been initialized properly at all;
2. It is initialized but it is not sized or positioned properly (for example, it could have a size of 0 by 0, or it is positioned outside of the visible area of the parent window);
3. The page you loaded indeed is a blank page;

For issue #1 and #2, you can use Visual Studio's built-in Spy++ tool to check both. When you see a blank page, open Spy++, then use the window finder tool to locate the tab window. This is the parent window of the WebControl.

From there on you should see a number of child windows in Spy++. The window tree should look something like this:

Code:
WindowsForms10.Window.8.app.0.141b42a_r8_ad1
  WindowsForms10.Window.8.app.0.141b42a_r8_ad1
    eo.nativewnd.v20.2.6.0.0.21083178
      eo.webbrowser.root
        Chrome_WidgetWin_0
          Chrome_RenderWidgetHostHWND
          Intermediate D3D Window


The exact numbers can be different but the window tree structure should be similar. The first line is the parent control of the WebControl (possibly a tab in your case). The second line is the WebControl. The third line and on are the internal windows created by the browser engine. You want to check:

1. You have a similar window tree. If not, then the WebControl is not properly intialized;
2. Right click each window and check their properties to make sure their position and size are correct;

If #2 is the problem, then you will need to debug your code to make sure that the WebControl is properly sized and positioned.

To troubleshoot #3, you can use the WebBrowser's built-in debug feature to check the page contents:

https://www.essentialobjects.com/doc/webbrowser/advanced/debug.aspx

If the page's content is indeed empty, then you will need to debug on your end to find out why. Obviously we have no way of telling why your server responded with an empty page.

If none of the those is the issue or if you see the WebControl not initialized at all (case #1), then you can try to isolate the problem into a test project and send the test project to us:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have that we will be happy to investigate further.

Hope this helps.

Thanks!
Roy
Posted: Thursday, July 16, 2020 4:00:24 AM
Rank: Newbie
Groups: Member

Joined: 7/14/2020
Posts: 3
I know the page is not at fault, because I've done logging with Wireshark before, and saw that when the white screen is shown, no attempt was made to even load the page. When the page is shown, there obviously is.

Anyway, I've done some snooping with Spy++, and I found the following:
1. In case the tab is not selected, the only window that is present is the main application window.
2. In case the tab is selected, and a white screen is shown, I see the same window tree as posted before, with one of 2 exceptions:
* The Intermediate D3D Window is not there
* The Intermediate D3D Window is above the Chrome_RenderWidgetHostHWND
3. In case the tab is selected, and the page is loaded, I see the same window tree as posted before.
Note that the main window in my case is not a windows forms app window, but a WPF window.

The window dimensions for the WebView are OK in every case where the tab is selected & the View is shown (the dimensions being 930 x 1063).

My immediate questions would then be: what is the Intermediate D3D window (what does it do?), and does the order in the window tree matter? I would guess so, given these results.
eo_support
Posted: Thursday, July 16, 2020 11:01:35 AM
Rank: Administration
Groups: Administration

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

The "Intermediate D3D Window" is the GPU's "composition surface" that produces the final output, so it does need to be the last one (to be on top). There might be some specific window styles you are setting in your application or the tabs that have impacted this. If GPU accelaration is not important for you, you can try to turn it off:

Code: C#
EO.WebEngine.EngineOptions.Default.DisableGPU = true;


Once the GPU is turned off, this window will not be created.

If that still does not resolve the issue, you can try to isolate the problem into a test project and send the test project to us:

https://www.essentialobjects.com/forum/test_project.aspx

We will be happy to investigate further once we have that.

Thanks!

Roy
Posted: Tuesday, July 21, 2020 4:30:10 AM
Rank: Newbie
Groups: Member

Joined: 7/14/2020
Posts: 3
Setting that value to false seems to fix the issue.

Alternatively, I also tried to just update to the latest version and that also seems to fix the issue.
The only problem I have now is that I can't go back to the version I had installed before since I can't find the installer. Is there a place where I can download older versions of the EO.Total package?
eo_support
Posted: Tuesday, July 21, 2020 1:35:47 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Glad to hear that. You can PM us your order number and the exact version you need and we will provide the download link to you.


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.