Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why webview2 is displayed as a white screen, but other computers can use the same application #3191

Open
qq386760345 opened this issue Feb 6, 2023 · 19 comments
Assignees
Labels
bug Something isn't working

Comments

@qq386760345
Copy link

Description
On my computer, when webview2 is opened, it is displayed as a white screen, and the webview2 runtime has been installed. But other computers can use the same application

Version
SDK:
Runtime: webview2 runtime version 109.0.1518.78
Framework: Winform
OS: Win10

Repro Steps

image
image

Additional context

@qq386760345 qq386760345 added the bug Something isn't working label Feb 6, 2023
@sln162
Copy link

sln162 commented Feb 8, 2023

image
初始化的方法中,判断有没有错误,如果没错误,等待130秒,看会不会出现超时错误。--In the initialization method, judge whether there is an error. If there is no error, wait for 130 seconds to see if there will be a timeout error.

@Huangpuguang
Copy link

I have the same problem, did you solve it?

@MarkusSchreiner
Copy link

MarkusSchreiner commented Mar 14, 2023

This behaviour also occurs with some of our customers who use our application, since about 3 weeks!
I would classify this as High Prio

As far as I know, restarting the application removes this error for some time.
What I also noticed is that the Windows PageFile is relatively large in the moment this behavior occurs (1.9 to 2.5 GB), but that could be a coincidence.

We currently shipped our application with WebView2 v1.0.1418.22.
All customers use, more or less, the recent Edge versions (~110.0.15xx.xx)

@Shangminx
Copy link
Contributor

Hi @qq386760345, Have you solved the problem? If not, may you provide some sample code for me to repro this issue? Or you can try to update the runtime version to latest.

@MarkusSchreiner
Copy link

This problem still occurs with many of our customers.

So far, I have not been able to find a possible cause.
My previous assumption about the PageFile is probably wrong, as the problem also occurs with low 'utilisation' of the PageFile.

@qq386760345
Copy link
Author

I have discovered a possible reason that when there are certain monitoring software on the device, including but not limited to ESET, it may be loaded together with webview2, which will trigger the integrity check of webview2, resulting in loading exceptions. You can avoid this issue by removing code integrity checks during initialization. The code example is as follows:

        private async void InitAsync()
        {
            try
            {

                var op = new CoreWebView2EnvironmentOptions("--disable-features=RendererCodeIntegrity");
                var env = await CoreWebView2Environment.CreateAsync(null, "C:\\temp", op);
                await webView21.EnsureCoreWebView2Async(env);
            }
            catch (Exception ex)
            {
                LOGGER.Error("InitAsync webview failed, ex ", ex);
            }
        }```

@MarkusSchreiner
Copy link

@qq386760345 Thank you - I will give it a try. Good investigation ! 👍

@sln162
Copy link

sln162 commented May 19, 2023

@qq386760345 If this is the case as you said, then increase the CoreWebView2_ProcessFailed event, then you should be able to capture the e.ExitCode -1073740760 event, right?

#2761 (comment)

@MarkusSchreiner
Copy link

MarkusSchreiner commented Jun 23, 2023

@Shangminx
Hello, I'm sorry to say, that this behaviour still occurs at some of our customers.
And this although I used the workaround with the environment option "--disable-features=RendererCodeIntegrity".

However, I have been able to gather a little more information:

  • It seems to be clearly related to one of Edge's render processes.

  • When the behaviour occurs, and I kill one of Edge's running render processes in the task manager, I receive the error 1 "COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED" reported via the ICoreWebView2ProcessFailedEventHandler.
    image

  • After killing one of the render processes, Edge seems to automatically kill all other remeining render processes and restarts all of them

  • When I receive the ICoreWebView2ProcessFailedEventHandler callback, I can react to this and automatically terminate and restart all existing WebView2 instances in my running application - then the rendering works again!

  • What else has been noticed:
    a) Before the white screen appears, the displayed HTML page was still rendered correctly. Only after the user 'interacted' with the page, i.e. marked text with the mouse, did the HTML page suddenly turn white.
    b) All subsequent navigation calls in this 'white' WebView2 instance were executed without errors/callbacks - but nothing was displayed.

Unfortunately, I cannot say under which circumstances the bug occurs - it seems to happen very randomly and very rarely.

@Shangminx
Copy link
Contributor

Hi @MarkusSchreiner, After you killing the render process and autorestart, did the white screen behaviour recover?

@MarkusSchreiner
Copy link

Hi @MarkusSchreiner, After you killing the render process and autorestart, did the white screen behaviour recover?

Yes, it did.

@beckart
Copy link

beckart commented Sep 11, 2023

I found that an app would have a white box over it on one monitor, but not on the other monitor. I also had a few other people with the same issue, and a lot that were not experiencing any problem. If anyone with the issue changed their monitor scaling to 100% the white box went away.

@victorhuangwq
Copy link
Collaborator

Hi, are people still facing this issue?

@beckart
Copy link

beckart commented Dec 3, 2023 via email

@criddell
Copy link

criddell commented Jan 8, 2024

We experience this issue as well. For us, we noticed it was happening whenever we were showing a MessageBox while the WebView2 was initializing. If we suppress the message box, it seems to start. Otherwise we get the blank view. If we kill and restart the web view, it starts working.

@DavidTynewyddBI
Copy link

Any news on this? We recently upgraded our UWP app to use WebView2 and now we have clients experiencing this issue. For some, disabling the integrity check worked initially, but stopped working when they restarted the app. For others it didn't work at all

@beckart
Copy link

beckart commented Feb 25, 2024

The issue appears to be fixed in Windows 11 however not yet patched in Windows 10. In our case we were using Delphi and as long as I turn “gdiScaling” to “false”, the issue was mitigated as a workaround.

@jamesjcurrie
Copy link

Some of our users are reporting a similar issue for our Excel addin which uses a WPF Webview2 browser to expose some functionality. The affected users seem to be on Windows 10 and run into the issue intermittently after some time. We are having trouble reproducing it as many of us are on windows 11. Will try some of the reported workarounds to see if there's any improvement.

@geocine
Copy link

geocine commented Aug 20, 2024

I experience same issue but very similar to this, #4141 . Mine turns white after I leave it open for some time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests