# Why IE opened when click a hyperlink in juce WebBrowser?

**URL:** <https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604>\
**Category:** General JUCE discussion\
**Created:** [October 23, 2011, 11:08am UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604 "2011-10-23T11:08:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![menzi1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/menzi1/32/170_2.png) [@menzi1](https://forum.juce.com/u/menzi1)\
**Post date:** [October 23, 2011, 11:08am UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604/1 "2011-10-23T11:08:42Z")

</div>

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() ?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 24, 2011, 9:29am UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604/2 "2011-10-24T09:29:48Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [October 24, 2011, 10:06am UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604/3 "2011-10-24T10:06:39Z")

</div>

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

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

check out  
[http://www.quackit.com/html/codes/html\_open\_link\_in\_new\_window.cfm](http://www.quackit.com/html/codes/html_open_link_in_new_window.cfm)

---

<div class="post-metadata">

**Author:** ![menzi1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/menzi1/32/170_2.png) [@menzi1](https://forum.juce.com/u/menzi1)\
**Post date:** [October 24, 2011, 4:14pm UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604/4 "2011-10-24T16:14:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [October 24, 2011, 4:24pm UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604/5 "2011-10-24T16:24:47Z")

</div>

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:

[http://msdn.microsoft.com/en-us/library/aa770041.aspx](http://msdn.microsoft.com/en-us/library/aa770041.aspx)

“… 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!

---

<div class="post-metadata">

**Author:** ![menzi1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/menzi1/32/170_2.png) [@menzi1](https://forum.juce.com/u/menzi1)\
**Post date:** [October 25, 2011, 8:29pm UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604/6 "2011-10-25T20:29:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [October 25, 2011, 9:58pm UTC](https://forum.juce.com/t/why-ie-opened-when-click-a-hyperlink-in-juce-webbrowser/7604/7 "2011-10-25T21:58:43Z")

</div>

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.
