GeckoFX浏览器在重新加载后显示空白页

时间:2019-05-01 14:20:45

标签: c# winforms geckofx

我正在为WinForms项目使用GeckoFX 60,但是某些网站存在问题。第一次打开就很好,但是在第二次重新加载或导航到同一网站后,它只是显示为空白。没有错误或警告。这是我的代码示例:

    public frmTest()
    {
        InitializeComponent();

        string strPath = Application.StartupPath + "\\xulrunner\\";

        Xpcom.Initialize(strPath);
    }

    string strPath = "https://m.formula55.net";

    private void frmTest_Load(object sender, EventArgs e)
    {
        wbTest.Navigate(strPath);

        wbTest.ConsoleMessage += _myWebBrowser_ConsoleMessage;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        wbTest.Navigate(strPath);
    }

因此,从这里开始,它第一次加载正常,但是当我单击我的button1时,它会显示白页。但是,DocumentCompleted事件被很好地触发了:

    private void wbTest_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
    {
        MessageBox.Show(wbTest.Url.AbsoluteUri);
    }

仅在某些网站上会发生此问题。大多数站点都可以正常工作。

任何帮助将不胜感激。

0 个答案:

没有答案