微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CefSharp 显示银行屏幕并在最小化和最大化窗口后刷新

如何解决CefSharp 显示银行屏幕并在最小化和最大化窗口后刷新

我们使用 Cefharp 版本 (84.4.10) 来加载插件。客户正在生产中使用它。但是,一些客户报告说他们在加载窗口时看到空白屏幕。

以下是团队为缩小/排除某些情况而尝试的一些方法

  • 问题不在于插件方面,因为能够重现 即使在加载 google.com 时,客户端也会出现问题
  • 即使在客户端计算机上禁用防病毒软件后,仍会继续查看问题。
  • 在 WinForm 和 WPF 窗口的情况下看到空白屏幕。
  • 团队无法在内部重现该问题,因此这是一个特定于机器的问题。
  • 该问题并非由客户端代码引起,因为我们能够使用独立应用在客户计算机上重现该问题。这对于排除导致此行为的任何产品代码很重要。因此,该团队能够将问题缩小到 Cefsharp。

按照其他用户的建议尝试解决问题的步骤

  • 禁用 GPU 加速:disable-gpu
  • 禁用 GPU 垂直同步:disable-gpu-vsync

使用 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 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?