How to determine navigation direction from IE WebBrowser (IHtmlWindow2 or Javascript)

I am using a WPF web browser control and when it fires the Navigating event, the event arguments always contain NavigationMode.New. It must be set to NavigationMode.Back if the user selects "Go Back" from a web control.

Therefore, it navigates to the COM ActiveX control to determine the direction of navigation. I have looked at IHtmlWindow2 and IHtmlDocument2 and IOmHistory, but I don't see anything happening on navigation to tell me if it is navigation related, going backwards, new address, or updating.

Since IHtmlWindow and Javascript have the same DOM, maybe someone knows how from Javascript.

I've also looked at the IWebBrowser2 interface, but can't find anything.

Is there any event or property I need to check?

0


source to share


1 answer


It turns out that this is impossible. Since the APIs mimic Javascript API and for security reasons JS cannot send browsing history over the Internet, there is no API over COM.



+1


source







All Articles