Sorry, to correct what I said about debugging earlier: it is 
FrameLoader::fireBeforeUnloadEvent() that is being successfully called, but 
still, nobody is listening to the event (by the time this gets to 
EventTarget::fireEventListeners() I see there that the listener map is empty.

Stan

From: Stan Pensak
Sent: Wednesday, March 27, 2013 11:48 AM
To: 'webkit-qt@lists.webkit.org'
Subject: JavaScript window.onbeforeunload event not appearing

Hi, working with a build of Qt 4.8.4, our JavaScript developers have complained 
that their code does not receive unload events (they're using dojo.addOnUnload 
but I know that this is triggered from window.onbeforeunload), when we destroy 
a QWebView, or even when we change its URL.  I have debugged a little and it 
looks like events are being dispatched from FrameLoader::stopLoading(), which 
itself is called from FrameLoader::closeURL(), but nobody is listening to them 
to pass them on to JavaScript.

In comparison, the Chrome and Safari browsers on my Windows system do 
successfully invoke the dojo.addOnUnload callbacks.

Is this a known issue?

Thanks,
Stan Pensak
_______________________________________________
webkit-qt mailing list
webkit-qt@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-qt

Reply via email to