Why IE opened when click a hyperlink in juce WebBrowser?


windows,juce Demo .the WebBrowserDemo
There are something I don’t understand

sometimes,when click a hyperlink ,the “DemoBrowserComponent” will
call pageAboutToLoad(XXX),make Textbox changes,and goToURL(XXX).
thats OK.

BUT, sometimes when click on a hyperlink,the page will be displayed in a new IE window,
not the juceWebBrowser.Why IE opened ?why no one call pageAboutToLoad() ?


Well, whether the embedded browser chooses to invoke the callback is really up to its discretion… I certainly have no idea how IE makes its mind up what to do when a link is clicked, I’m afraid!


I think it’s because some links have their HTML set to be opened in a new window, like this one:

<a href="http://www.quackit.com/html/html_help.cfm" target="_blank">HTML Help</a> 

check out


THX! I think that’s the answer…“Open in a new window”!
So…Can I do something to avoid this?


Sure you can.

You need to work on the underlying IWEbBrowser2 component that Juce wraps.

Just follow Microsoft’s explanation on how to do it:


“… You can intercept an event, DWebBrowserEvents2::NewWindow2, in your IDispatch implementation to control this. Your control needs to connect to the DWebBrowserEvents2 connection point to intercept this event.”

Good Luck!


THX agian!! That’s cool! And…forgive me but how about on os?


You should be able to do the same thing with the WebView in Osx.
I know that Jules added a web browser for iOS too lately, but unfortunately I’m not familiar with any of them.