Problems with IWebBrowser2 - how to open documents in new windows?

I have an IWebBrowser2 ctrl built into my own dialog. I just want to display a promo banner in it from my URL. How to disable popup window menu items from a control and make it open links in a new window (currently, when I click a link in a banner, it opens within the same control). Regards Dominic

+1
source share
2 answers

Take a look at the following article:

Configure WebBrowser

+2
source

I don’t know if there is a more convenient way to do this, but you can always intercept BeforeExplorerNavigate2() , set the out-parameter cancel parameter to true and from there either execute a new Navigate() with a different name for the frame or open a new window.

As Rob noted, there may be problems with filtering navigation events originating from scripts, see this question .

+2
source

Source: https://habr.com/ru/post/907153/


All Articles