Link to home
Start Free TrialLog in
Avatar of gilad_no
gilad_no

asked on

WebBrowser, dynamic content and history

My wtl application uses an html view window as its main view. It should handle static html files and dynamic content. To load a static page I simply navigate to its url on disk and when I have to use dynamic content, I handle the OnBeforeNavigate2 event and inject some html content to it. I have a problem when trying to use the GoBack() and GoForward() functions since I've canceled the original event (in OnBeforeNavigate2) and the browser didn't add the url into history. How can I add the url manually to the history list of the navigation?
Avatar of DanRollins
DanRollins
Flag of United States of America image

Thanks for that excellent problem description.

The window.history object does not expose a collection, so there may not be a way to add anything.  As a first suggestion, you could avoid canceling the OnBeforeNavigate2 and inject the HTML into the DOM after OnDocumentComplete (or whatever).  I'll try a fe things and see if that is feasible...

-- Dan
Avatar of gilad_no
gilad_no

ASKER

I can't inject it with OnDocumentComplete because I don't want IE to start and search the url using the default search method. I know there is an interface (ITravelLogStg) to handle the history list, but I can't find it anywhere (I have the latest platform SDK)
I can't inject it with OnDocumentComplete because I don't want IE to start and search the url using the default search method. I know there is an interface (ITravelLogStg) to handle the history list, but I can't find it anywhere (I have the latest platform SDK)
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I see it only supports IE 5.5. Can't I do something similar with IE 5.01?
Why bother?  Everyone has upgraded to 5.5 or 6 by now.
-- Dan