Re: BeforeNavigate2 event
- From: "James" <j DOT w AT zoom DOT co DOT uk>
- Date: Fri, 10 Nov 2006 11:17:03 -0800
Thanks Troels!! This did the trick - all makes sense.
James
"Troels Jakobsen" <dont@xxxxxxxxx> wrote in message
news:eEyXtVDBHHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
"James" <j DOT w AT zoom DOT co DOT uk> wrote in message
news:e79Emi0AHHA.3836@xxxxxxxxxxxxxxxxxxxxxxx
I have been hooking into the beforenavigate2 event and am noticing some
weird behavior on some web pages and was hoping someone could provide some
explanation.
If I browse to a website such as www.msn.com, and put a breakpoint in the
beforenav event, the event fires approx 4-5 times for every nav to that
page. If I look at the 'url' param for the event for each call it is:
call1: www.msn.com
call2: about:blank
call3: about:blank
call4: about:blank
call5: about:blank
once the call stops www.msn.com is sure enough there.
Lastly, if I do the same in OnDocumentComplete, the url is always
www.msn.com, that event too fires 4 or 5 times.
Any insight given greatly appreciated.
James
It's because msn.com contains 5 frames, as can be seen by entering this
into the browser's address bar once msn.com is loaded:
javascript:alert(frames.length);
Each one of these frames will fire the NavigateComplete2 and
DocumentComplete events.
If you only want to respond to the event once all frames are loaded,
here's how to:
http://support.microsoft.com/kb/q180366/
Troels
.
- References:
- BeforeNavigate2 event
- From: James
- Re: BeforeNavigate2 event
- From: Troels Jakobsen
- BeforeNavigate2 event
- Prev by Date: How to show a tool tip on an IWebbrowser2 control embedded in a Cdialog
- Next by Date: Re: E7/Vista - WebBrowser control embedded in toolbar's dialog opening new window.
- Previous by thread: Re: BeforeNavigate2 event
- Next by thread: E7/Vista - WebBrowser control embedded in toolbar's dialog opening new window.
- Index(es):
Relevant Pages
|
|