MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
445 stars 53 forks source link

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

Open qq386760345 opened 1 year ago

qq386760345 commented 1 year ago

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

sln162 commented 1 year ago

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 commented 1 year ago

I have the same problem, did you solve it?

MarkusSchreiner commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

sln162 commented 1 year ago

@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?

https://github.com/MicrosoftEdge/WebView2Feedback/issues/2761#issuecomment-1240969009

MarkusSchreiner commented 1 year ago

@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:

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

Shangminx commented 1 year ago

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

MarkusSchreiner commented 1 year ago

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

Yes, it did.

beckart commented 1 year ago

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 commented 10 months ago

Hi, are people still facing this issue?

beckart commented 10 months ago

Yes, the issue still exists and I can replicate it with a laptop running Windows 10 and attached monitor.

With the laptop set to scale 150% and a resolution of 1920 X 1200 and the monitor set to scale 100% and resolution 1920 X 1080 the white box will appear on the laptop and moving the app to the monitor results in the white box disappearing. This is not random and I can replicate it using these settings.

The issue has not been significant as

Removing identifying details this is a frame from a CamStudio recording I have. The picture is of the extended display (2 monitors) and the app being on the monitor shows correctly. @.***

Another frame after the move to the laptop monitor. Although difficult to see white on white the box covers the input area. @.***

@.*** The form, with the white box over it.

@.***The form can be pulled from under the white box, and when that happens the size, and location of the white box changes.

From: Victor Huang @.> Sent: Saturday, 2 December 2023 9:39 AM To: MicrosoftEdge/WebView2Feedback @.> Cc: Bruce Eckart @.>; Comment @.> Subject: Re: [MicrosoftEdge/WebView2Feedback] Why webview2 is displayed as a white screen, but other computers can use the same application (Issue #3191)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification CYBERSECURITY ALERT: This is an email from an external organization. Use caution, especially with links and attachments. Morehttps://airtime.linde.com/phishing

Hi, are people still facing this issue?

— Reply to this email directly, view it on GitHubhttps://github.com/MicrosoftEdge/WebView2Feedback/issues/3191#issuecomment-1836872755, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABH3YHX3UJXFWUIS5Z6G46DYHJL6RAVCNFSM6AAAAAAUSFYH32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZWHA3TENZVGU. You are receiving this because you commented.Message ID: @.***>

The information contained in this email and any attachments may be confidential and is provided solely for the use of the intended recipient(s). If you are not the intended recipient, you are hereby notified that any disclosure, distribution, or use of this e-mail, its attachments or any information contained therein is unauthorized and prohibited. If you have received this in error, please contact the sender immediately and delete this e-mail and any attachments. No responsibility is accepted for any virus or defect that might arise from opening this e-mail or attachments, whether or not it has been checked by anti-virus software.

criddell commented 9 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 6 months ago

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 commented 1 month ago

I experience same issue but very similar to this, https://github.com/MicrosoftEdge/WebView2Feedback/issues/4141 . Mine turns white after I leave it open for some time