pop-up blocker and ActiveX controls, part one: IWebBrowser::Navigate(), IWebBrowser::Navigate2()
As I mentioned previously, one reason users may continue to experience unwanted pop-up windows while browsing is creative use of ActiveX controls that provide methods that allow web sites to open new browser windows. This series of posts will provide best-practices for ActiveX control implementors.
There are two things to keep in mind while considering this topic. The first is, as always, we are committed to application and site compatibility and thus a lot of the pop-up blocker is opt-in and in the abscence of concrete knowledge that a pop-up is unwanted, our default is often to allow the pop-up. The second thing is there are an incredible number of ways to navigate IE, so this will, necessarily, be part one in a survey of this multitude.
Note: If you are a user (and not an ActiveX control developer), and have found this post in an attempt to track down why you are still seeing unwanted pop-up windows, please refer to this post.
Method: IWebBrowser::Navigate(), IWebBrowser2::Navigate2()
Mitigation: Each of these methods takes a set of BrowserNavConstants in the Flags parameter. Controls (and applications) should pass navNewWindowsManaged if they desire pop-up blocker to be applied. Clues that you want this flag would be such things as you are also passing navOpenInNewWindow or are targeting a frame name via the TargetFrameName parameter and that frame may not exist--in which case a new browser window may be created with that name.
Comments
Anonymous
May 17, 2006
Nice to see navNewWindowsManaged and company are now documented online. The most recent Platform SDK (the 2003 R2 release) doesn't have any of the XP SP2 constants.Anonymous
January 11, 2007
PingBack from http://www.ie7security.net/2007/01/11/pop-up-blocker-and-activex-controls-part-one-iwebbrowsernavigate-iwebbrowsernavigate2/Anonymous
January 21, 2007
PingBack from http://www.ie7security.net/2007/01/21/pop-up-blocker-and-activex-controls-part-one-iwebbrowsernavigate-iwebbrowsernavigate2-2/Anonymous
January 21, 2007
PingBack from http://www.ie7security.net/2007/01/21/pop-up-blocker-and-activex-controls-part-one-iwebbrowsernavigate-iwebbrowsernavigate2-3/Anonymous
February 08, 2007
PingBack from http://www.ie7security.net/2007/02/08/pop-up-blocker-and-activex-controls-part-one-iwebbrowsernavigate-iwebbrowsernavigate2-2/Anonymous
August 14, 2008
PingBack from http://www.ie7security.net/2008/08/14/pop-up-blocker-and-activex-controls-part-one-iwebbrowsernavigate-iwebbrowsernavigate2-3/Anonymous
February 21, 2009
PingBack from http://www.ie7security.net/2009/02/21/pop-up-blocker-and-activex-controls-part-one-iwebbrowsernavigate-iwebbrowsernavigate2-4/Anonymous
May 03, 2009
PingBack from http://www.ie7security.net/2009/05/03/pop-up-blocker-and-activex-controls-part-one-iwebbrowsernavigate-iwebbrowsernavigate2-5/