Visual Basic browser
I'm coding a browser in Visual Basic 6 using Microsoft Internet Controls, but I have a problem which I just can't figure out how to solve.
When you refresh a page to which you sent POST data, it asks for confirmation before sending it again (just like in IE). Can this somehow be disabled?
I know that I can use WebBrowser.navigate() and add the POST data manually but not how to remove the confirmation box from the refresh function.
What I'm trying to do is to make something like the Firefox addon ReloadEvery (https://addons.mozilla.org/en-US/firefox/addon/115)
Thanks in advance :)
As a possible workaround, you could try using a String variable to capture the destination URL every time the WebBrowser.Navigating (I think) event fires. Then, whenever you want to use your refresh functionality, it could manually navigate to the URL in that String, which would be the last one browsed to (the current page).
I already save those in a combobox (just like in FF and IE), but this won't save the POST data :| it's necessary that it can resend this as well.
If this is impossible I guess I'll add something which takes an URL and the POST data as arguments and sends them through navigate, however this forces you to check the input names and stuff manually :angry:
Uber0n wrote: I already save those in a combobox (just like in FF and IE), but this won't save the POST data :| it's necessary that it can resend this as well.
If this is impossible I guess I'll add something which takes an URL and the POST data as arguments and sends them through navigate, however this forces you to check the input names and stuff manually :angry:
I guess it would be possible to catch the original POST request in the WebBrowser.Navigating event, since that event fires before the POST actually occurs. Of course, how you would go about that… I'm not so sure. Sounds interesting, though… if I find out how, I'll write an article on it. :happy:
Manually? Nah, not so much… it can be automated relatively easily. You can look at my craptabulous first article for a brief introduction to mshtml and WebBrowser 2.0; this will apply to the classic WebBrowser object also, but M$ changed where the DOMDocument is stored between the WebBrowser and WebBrowser 2.0 objects.
Finally, you could try using WinHTTP instead of the WebBrowser, as briefly mentioned here:
http://www.eggheadcafe.com/community/aspnet/8/4703/suggest-not-using-ie-appl.aspx
I don't know that it's any better for your application than the WebBrowser object, but it may prove easier to work with. Anyways, you could still use a WebBrowser object and just put the HTTPResponse text as the WebBrowser's document. :)
That navigating event sounds interesting, I'll take a closer look after writing this post. Your article can probably be useful too.
I don't think I'll use WinHTTP. Let's just hope it's possible to solve in a smart way keeping the WebBrowser, I'll be able to try some new stuff on Thursday.
Thanks a lot for your ideas! Just tell me if I can help you with anything :happy: