Bug 107918

Summary: javascript alert() locks focus -> tab can't be closed
Product: [Applications] konqueror Reporter: Jan Kundrát <jkt>
Component: khtml ecmaAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: wishlist CC: faure, lex.lists
Priority: NOR    
Version: 3.4.1   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: konq-alert.html

Description Jan Kundrát 2005-06-22 15:25:13 UTC
Version:           3.4.1 (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)
 
OS:                Linux

Open http://www.brmbrm.wz.cz/ in konqueror. This page has a *lot* of "<script> alert('blah');</script>"-like lines. When the javascript window pops up, you can't any longer access main window of konqueror and keyboard shortcuts don't work anymore.

Simple kill will kill entire session with all open tabs. Good folks on #kde pointed me to the DCOP stuff, so I used `dcop konqueror-$PID html-widget* setJScriptEnabled false` which did the job.

Suggestion: allow the alert window to give its focus away because I don't think that most users will play with DCOP.
Comment 1 lexual 2005-07-11 16:01:05 UTC
confirming for 3.4.1, visit that link and you can't close the konqueror window or do anything in konqueror.
Comment 2 lexual 2007-12-13 02:44:15 UTC
site now invalid?
Comment 3 Jan Kundrát 2007-12-13 12:12:47 UTC
Site that is no longer accessible doesn't magically make that problem go away.
Comment 4 Jan Kundrát 2007-12-13 12:13:40 UTC
Created attachment 22523 [details]
konq-alert.html

This file should be enough. It displays ten alert boxes before letting you
close the web page.
Comment 5 David Faure 2010-04-03 00:14:33 UTC
Don't all web browsers behave the same on such pages?
Comment 6 Jan Kundrát 2010-04-05 22:55:06 UTC
David, even though it very well could be a common behavior (I haven't studied any heuristics about the maximal number of popups to show), it doesn't change anything on the fact that such a behavior is extremely annoying.

The only way for a user to deal with such a page is to kill the whole session, possibly losing all work (alert popups are modal per window, not per tab).
Comment 7 Maksim Orlovich 2010-04-05 23:18:53 UTC
The "good" way of dealing with this (which I think Opera(?) offers) is to have a script-killing checkbox in the alert. Hmm, I really ought to be the person to know how script killing should work, shouldn't I?
Comment 8 Christoph Cullmann 2024-05-06 20:51:20 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