title: Webbrowser dialog popup block
body: <p>I am developing a program which has an invisible web browser control that is used for loading data from certain web pages. However, I am having trouble blocking a certain type of popup.</p>
  
  <p>This is the code I am currently using to block popups </p>
  
  <pre><code>private void webBrowser1_NewWindow( object sender, 
                                      System.ComponentModel.CancelEventArgs e)
  {
    e.Cancel = true;
  }
  </code></pre>
  
  <p>I have tested it on <a href="http://www.popuptest.com/" rel="nofollow">http://www.popuptest.com/</a> and it fails to block the Come &amp; Go test and the Modeless Window test. <a href="http://i75.servimg.com/u/f75/13/13/40/49/b11.png" rel="nofollow">http://i75.servimg.com/u/f75/13/13/40/49/b11.png</a></p>
  
  <p>Is there a way to block these popups?</p>
  
  <p>This is the javascript which shows the popups</p>
  
  <pre><code>function modelesswin(url,mwidth,mheight){
  if (document.all&amp;&amp;window.print) //if ie5
      eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
  else
  eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
  }
  
  
  modelesswin("http://www.popuptest.com/popup1.html",600,600)
  </code></pre>