Link to home
Start Free TrialLog in
Avatar of dbalman
dbalman

asked on

WebBrowser Control and the NewWindow2 event

My webbrowser control loads a page from a secure site. Some of the popup links on that page are located within that site and I must load them in a new instance of the webbrowser or I will be presented with another logon dialogue. Other links are off site (unsecured) and can be opened in a new instance of IE. My preference would be to open all popup links in IE.

My question is, how can I determine which link has been clicked before the NewWindow2 event? The BeforeNavigate2 is not called before a popup window. Even better would be to pass all popup windows to IE but I can't figure out how to do this without receiving a logon dialogue.
Avatar of vb_elmar
vb_elmar
Flag of Germany image

Can you post the URL of the site?
Avatar of dbalman
dbalman

ASKER

No, it's internal.
In order to get an answer for this question it would be helpful, if we get the link
of a comparable http site, because this is a VB expert forum (not a html expert forum).
Avatar of dbalman

ASKER

This is not a HTML question. Please reread the question. If further clarification is required then please ask.
When writing a code for your problem, a sample http site would be helpful for testing purposes. At this
moment, a testing site is not available, therefore i would need to program the testing site by myself (e.g. with
frontpage). But to write a site by myself is too time-consuming for me.
Avatar of dbalman

ASKER

Maybe this will help.  I need the URL being navigated to before the NewWindow2 event.


Private Sub Form_Load()

WebBrowser1.Navigate2 "About: Blank"

WebBrowser1.Document.write "<A href=""https://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/"" target=_blank>https://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/</A><DIV></DIV><A href=""http://www.google.com/""target=_blank>http://www.google.com</A>"
 
End Sub

I can't provide a secure link as that would entail providing the account to access that site also. I will max the points if someone does figure out how to open https popups (located in a webbrowser control) in IE.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of vb_elmar
vb_elmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dbalman

ASKER

At first I couldn't figure out why your solution was firing the forms NewWindow2 event and mine wasn't. It then it occurred to me that I am using a separate form and webbrowser to handle pop-ups. I need to watch its NewWindow2 event then I can send it to IE or a new pop-up form. I overlooked the obvious and I appreciate your help.