How do I suppress script errors when using the WPF WebBrowser control?

前端 未结 8 1785
余生分开走
余生分开走 2020-12-02 09:34

I have a WPF application that uses the WPF WebBrowser control to display interesting web pages to our developers on a flatscreen display (like a news feed).

The tro

8条回答
  •  天命终不由人
    2020-12-02 10:34

    Just found from another question, this is elegant and works great.

    dynamic activeX = this.webBrowser1.GetType().InvokeMember("ActiveXInstance",
                    BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
                    null, this.webBrowser1, new object[] { });
    
    activeX.Silent = true;
    

提交回复
热议问题