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.
This is the code I am currently using to block popups
private void webBrowser1_NewWindow( object sender,
System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
}
I have tested it on http://www.popuptest.com/ and it fails to block the Come & Go test and the Modeless Window test. http://i75.servimg.com/u/f75/13/13/40/49/b11.png
Is there a way to block these popups?
This is the javascript which shows the popups
function modelesswin(url,mwidth,mheight){
if (document.all&&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)