Bug 110359 - Support for onbeforeunload messages
Summary: Support for onbeforeunload messages
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml event (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-07 19:37 UTC by apm13
Modified: 2024-05-06 20:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description apm13 2005-08-07 19:37:30 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Gentoo Packages
OS:                Linux

It would be very nice if konqueror/khtml/kjs supported messages (alerts) triggered by window.onbeforeunload events.  This feature, though non-standard, exists in IE and Firefox and is very useful for alerting users to unsaved form entries.  A sample usage is below:

<html>
<head>
<script type="text/javascript">
function foo(event) {
    if (!event) event = window.event;
    return 'some message';
}
window.onbeforeunload = foo;
</script>
</head>
<body>
<a href="http://kde.org">kde.org</a>
</body>
</html>

In FF and IE this automatically pops up a confirmation dialog whenever the user attempts to navigate away from the page.  In konqueror nothing happens. :(  Thanks for a great browser.
Comment 1 Andy Goossens 2007-12-16 17:20:25 UTC
It would be nice if Konqueror supports this feature.

Related documentation/discussion:
http://msdn2.microsoft.com/en-us/library/ms536907.aspx
http://bugzilla.mozilla.org/show_bug.cgi?id=68215

Demo:
http://www.4guysfromrolla.com/demos/OnBeforeUnloadDemo1.htm
Comment 2 Allan Sandfeld 2008-02-27 15:29:04 UTC
Is implemented in Safari, could be ported.

I've seen functionality equivalent to what this event accieves in some sites. What is the work-around? 
Comment 3 Holger Hees 2010-02-15 13:51:37 UTC
It is supported by IE, Firefox, Safarie, Chrome... but not in KDE 4.4 khtml.

i use it to switch session cookie in to different tabs before unload.
Comment 4 Christoph Cullmann 2024-05-06 20:56:41 UTC
Dear user,

KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6.

Please migrate to use a QWebEngine based HTML component.

We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes.

For security issues, please see:

https://kde.org/info/security/

Sorry that we did not fix this issue during the life-time of KHTML.

Greetings
Christoph Cullmann