How to determine direction of navigation from IE WebBrowser (IHtmlWindow2 or Javascript)
        Posted  
        
            by Geoff Cox
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Geoff Cox
        
        
        
        Published on 2008-11-08T03:09:17Z
        Indexed on 
            2010/03/25
            3:03 UTC
        
        
        Read the original article
        Hit count: 514
        
I'm uisng the WPF Web Browser control and when it fires the Navigating event, the event args always contain NavigationMode.New. It should be set to NavigationMode.Back if the user chooses to 'Go Back' from the web control.
So its off to the COM ActiveX control underneath to determine the direction of navigation. I've been looking at IHtmlWindow2 and IHtmlDocument2 and IOmHistory, but don't see anything that happens on navigation to tell me if the navigation is caused by going back, forward, a new address, or a refresh.
Since IHtmlWindow and Javascript have the same DOM, maybe someone knows how from Javascript.
I've also been looking at the IWebBrowser2 interface, but can't find anything there either.
Is there an event or property I need to inspect?
© Stack Overflow or respective owner