如何禁止WebBrowser控件中浏览网页时弹出JS对话框?       禁示js代码中的 alert("错误") 的执行?谢谢各位的观注!

解决方案 »

  1.   

    WebBrowser1.Silent :=True; 这样设置了,还是会弹出 "alert()"对话框,他只可禁示脚本出错提示框
      

  2.   

    var
      Hwnd: THandle;
    Hwnd := FindWindow(PChar('#32770'), PChar('Microsoft Internet Explorer'));
    if Hwnd <> 0 then SendMessage(Hwnd, WM_CLOSE, 0, 0);
    //#32770是Dialog的Class,'Microsoft Internet Explorer'是其Caption