private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
 {
        IHTMLWindow2 ihtmlWin = webBrowser1.Document.Window.DomWindow as IHTMLWindow2;
        //屏蔽alert
        string s = "var aaa=function(){return true;}\r\nwindow.alert = aaa;\r\nwindow.confirm = aaa;\r\nwindow.open = aaa;\r\nwindow.showModalDialog = aaa;";
        ihtmlWin.execScript(s, "javascript");
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2021-12-25
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案