other pop-up blocking bho's cancelling my navigation.
- From: ryan0x4 <ryan0x4@xxxxxxxxx>
- Date: Thu, 6 Mar 2008 20:35:24 -0800 (PST)
Hello,
My problem is, from inside my BHO I'm trying to open a link in a new
window. I'm doing this via initiating a Navigate2 command with either
the target set to "_blank" or navOpenInNewWindow/0x01 flag set in the
options. On this new window I'm initiall hiding it, setting certain
display options, and waiting for it to load completely before showing
it to the user.
When I do this, many common toolbars (google/yahoo for example) have
pop-up blockers that detect this as a pop-up and close it. My BHO
never receives the NewWindow2 notification, and I can't find a way to
detect the cancellation.
Is it possible to ensure my BHO's NewWindow2 connection gets called
before any other BHO's?
I have tried the following work-arounds without avail:
a) Using IE automation via CoCreateInstance(INTERNET_EXPLORER)
Problem is, mshtml within the control steals focus as soon
as I make this call, I can reset the focus afterwards but it results
in a screen flicker + user loses scrolling, drag/dropping, couple
other UI issues that I have been unable to resolve. Have tried
LockWindowUpdate, AllowSetForegroundWindow, and too many other
approaches to list without success. The focus steal happens exactly
on the CoCreateInstance() call.
b) Hosting the control.
This alleviates the focus problem, but I would like the window to
behave exactly as the users' normal web browser would. I don't want
to inconvenience them in any way. Is there an easy way to mimic/
duplicate what IE does in terms of ensuring all other extensions/bhos
get loaded, setting the window title appropriately, etc. get adhered
to, or is this out of the question?
c) CreateProcess() and friends.
Again, this would also work, but seems like it wastes resources
and there is definitely a delay/period of error where I need to launch
the application and attempt to get a reference to it via
IShellWindows. Again doesn't seem like an elegant solution, if the
browser crashes or anything else could end up with zombiesque hidden
IE's, although so far this is the most managable solution I have came
up with.
d) Fooling popup blockers. Have actually tried simulating clicks,
manually setting SHIFT+CTRL state on keyboard then restoring it,
opening "javascript:void(0);" type urls as destination all without
success for one reason or another, mainly because each one of them
appears to act differently in how they detect/classify windows as pop-
ups. They also do not adhere to IE's registry settings of allowed
popup hosts.
Any ideas or comments appreciated, have been struggling with this
problem for the better part of the day.
.
- Prev by Date: Re: AxWebBrowser - not firing all events
- Next by Date: Re: can't open ActiveX-based resource in Web browser control using IE7 and IE8 beta1
- Previous by thread: Re: AxWebBrowser - not firing all events
- Next by thread: Re: can't open ActiveX-based resource in Web browser control using IE7 and IE8 beta1
- Index(es):
Relevant Pages
|