1

after much research I've been trying to find a code that not only captures popup links in the webbrowser for it to navigate in, but also works on javascript codes that open new windows or popups. i tried using the webbrowser1_newwindow event with the following code (and works great)

    ' prevent opening a new window
    e.Cancel = True
    WBAccountVirgin.Navigate(e.Url.ToString)

but it doesn't work with javascript code using: javascript:newPopup

i managed to remove the javascript code as a string and just navigate to that and also works but not every time. So here's the question: What code can i use that works with every sort of newwindow event or popup where i don't need to provide the url beforehand of that popup? Also that works with javascript popup codes.. I've seen that most places people offer the solution of using the NewWindow2 and NewWindow3 event but that isn't even part of the pre-loaded Webbrowser control which i am using. I don't want to use the Microsoft Webbrowser that i have to import. I want to use the WebBrowser Control which is already loaded.

John Saunders
  • 160,644
  • 26
  • 247
  • 397

0 Answers0