Re: Getting headers when handling DISPID_BEFORENAVIGATE2 (2)
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Tue, 4 Oct 2005 10:00:21 -0400
Scherbina Vladimir <vladimir.scherbina[anti-spam]gmail.com> wrote:
> I need to get headers when handling DISPID_BEFORENAVIGATE2 event in
> my BHO. I found previous posts related to my problem
> (http://www.tech-archive.net/Archive/InetSDK/microsoft.public.inetsdk.programming.webbrowser_ctl/2004-11/0020.html)
> but seems that nobody found answers.
See if this helps:
http://groups.google.com/group/microsoft.public.inetsdk.programming.mshtml_hosting/msg/76bf4910a289d4b3
> Actually I need to get "Location" header from my BHO to detect
> redirection. Any ideas ?
Location: is a response header, sent by the server to the client. At the
time BeforeNavigate2 is called, no request has been made yet, so
response headers can't possibly be available.
The easiest way to detect redirections is to remember a URL in
BeforeNavigate2, then in NavigateComplete2 retrieve the final URL with
document.location.href. The former is the URL the navigation started
with (e.g. the URL specified in the link being clicked), the latter is
the final target of a chain of redirects, if any.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- References:
- Getting headers when handling DISPID_BEFORENAVIGATE2 (2)
- From: Scherbina Vladimir
- Getting headers when handling DISPID_BEFORENAVIGATE2 (2)
- Prev by Date: Getting headers when handling DISPID_BEFORENAVIGATE2 (2)
- Next by Date: Re: Get all styles of specific html-tag?
- Previous by thread: Getting headers when handling DISPID_BEFORENAVIGATE2 (2)
- Index(es):