Iwebbrowser2 Javascript onQuit event

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
thile
Knows some wx things
Knows some wx things
Posts: 26
Joined: Sat Oct 25, 2008 3:46 pm

Iwebbrowser2 Javascript onQuit event

Post by thile »

We use an embedded browser to show a specific webpage that has a rich text editor.

This text editor has hooked itself onto some events to detect when the browser tries to close/leave the page. The editor will validate that the latest changes are saved, and if not it will prompt the user to do so.


If the page is opened in a standalone Internet explorer, both navigating away (by typing new url), and closing the tab/window, will trigger the javascript.


When the page is shown in the embedded Iwebbrowser2 control and we send a new url, the javascript is properly triggered. But we are unable to get the event for close.

When we close the frame the control is hosted in, all the panels/controls just gets destroyed.

How do I programmatically tell the Iwebbrowser2, that we are about to close?

I have also tried to call the Quit function when I receive the onCloseEvent for my frame.
Calling Iwebbrowser2::Quit has so far not worked at all. The function does always return e_fail.



I can demonstrate it with the wxactivex sample.
I have changed it to default open this url: http://www.4guysfromrolla.com/demos/OnB ... dDemo1.htm
Closing the program does not bring up the confirmation dialog.
You do not have the required permissions to view the files attached to this post.
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am

Re: Iwebbrowser2 Javascript onQuit event

Post by Auria »

I do not have an answer as this is quite complex stuff. But are you aware of wxWebView in wx 2.9? This one would be officially supported
"Keyboard not detected. Press F1 to continue"
-- Windows