Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

adding "pop up ads blocking" feature to a custom browser

I am designing a web browser using the microsoft web control , how can I add a "block pop up ads" feature to it ?
0
adeljad
Asked:
adeljad
  • 2
1 Solution
 
DarkoLordCommented:
Hello, use this:

Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Set ppDisp = Nothing
    Cancel = True
End Sub

Darko
0
 
BurbbleCommented:
Just a warning, with certain versions of Internet Explorer I have noticed that it tends to crash when you block new windows from opening like that. I would recommend giving the user a choice of enabling/disable it, just in case.

-Burbble
0
 
adeljadAuthor Commented:
The problem with this method is that it will block the window even when you right click on a link and choose "open in new window" .
how can I fix that ?
0
 
DarkoLordCommented:
I don't think there is an easy way to do this...

Darko
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now