如何解决CefSharp 显示银行屏幕并在最小化和最大化窗口后刷新
我们使用 Cefharp 版本 (84.4.10) 来加载插件。客户正在生产中使用它。但是,一些客户报告说他们在加载窗口时看到空白屏幕。
以下是团队为缩小/排除某些情况而尝试的一些方法。
- 问题不在于插件方面,因为能够重现 即使在加载 google.com 时,客户端也会出现问题
- 即使在客户端计算机上禁用防病毒软件后,仍会继续查看问题。
- 在 WinForm 和 WPF 窗口的情况下看到空白屏幕。
- 团队无法在内部重现该问题,因此这是一个特定于机器的问题。
- 该问题并非由客户端代码引起,因为我们能够使用独立应用在客户计算机上重现该问题。这对于排除导致此行为的任何产品代码很重要。因此,该团队能够将问题缩小到 Cefsharp。
使用 WPF 窗口的独立代码
public partial class MainWindow : Window
{
public const double WINDOWWIDTHPER = 27.5;
public const double WINDOWHEIGHTPER = 80;
private ChromiumWebbrowser webbrowser;
public MainWindow()
{
InitializeComponent();
double deskHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
double deskWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
int windowWidth = Convert.ToInt32(((double)deskWidth) * (WINDOWWIDTHPER / 100.0));
int windowHeight = Convert.ToInt32(((double)deskHeight) * (WINDOWHEIGHTPER / 100.0));
this.Width = windowWidth;
this.Height = windowHeight;
string path = File.ReadAllText("C:\\file.txt");
string LogFile = System.IO.Path.Combine(path,"browser.log");
var settings = new CefSettings();
settings.LogFile = LogFile;
settings.LogSeverity = LogSeverity.Verbose;
settings.CefCommandLineArgs.Add("disable-gpu"); // disable GPU acceleration
settings.CefCommandLineArgs.Add("disable-gpu-vsync"); //disable GPU vsync
Cef.Initialize(settings);
webbrowser = new ChromiumWebbrowser();
webbrowser.Address = "https://google.com";
this.mainGrid.Children.Add(webbrowser);
this.ShowDialog();
}
}
以下是详细日志中的错误
错误 1
[0722/170611.925:VERBOSE1:configured_proxy_resolution_service.cc(1167)] Failed configuring with PAC script,falling-back to manual proxy servers.
错误 2
Line 812: Histogram: Net.Certificate.IgnoreCertificateErroRSSPKIListPresent recorded 1 samples,mean = 0.0 (flags = 0x1)
Line 816: Histogram: Net.Certificate.IgnoreErrors recorded 2 samples,mean = 0.0 (flags = 0x1)
Line 1112: Histogram: Net.QuicSession.CloseAllSessionsError recorded 2 samples (flags = 0x1)
Line 1192: Histogram: Net.SSL_Connection_Error recorded 17 samples (flags = 0x1)
Line 1255: Histogram: Net.SpdySession.ClosedOnError recorded 11 samples (flags = 0x1)
Line 2176: Histogram: DirectWrite.Fonts.Proxy.MessageFilterError recorded 14 samples,mean = 1.0 (flags = 0x1)
Line 2181: Histogram: diskCache.4.Error recorded 2 samples,mean = 7.5 (flags = 0x1)
Line 2915: Histogram: UMA.PersistentAllocator.FieldTrialAllocator.Errors recorded 0 samples (flags = 0x1)
请从客户框中找到随附的 Bankscreen screen short。非常感谢您对此的任何帮助!!!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。