Bug 58650 - Smart popup policy fails on sharereactor.com
Summary: Smart popup policy fails on sharereactor.com
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: kjs (show other bugs)
Version: 4.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-18 20:30 UTC by Ralf Holzer
Modified: 2003-06-06 18:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase for sharereactor.com popup code (608 bytes, text/html)
2003-05-24 18:29 UTC, Ralf Holzer
Details
Patch for kjs_html.cpp (2.10 KB, patch)
2003-06-01 17:07 UTC, Ralf Holzer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Holzer 2003-05-18 20:30:42 UTC
Version:           4.0 (using KDE 3.1.9)
Compiler:          gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
OS:          Linux (i686) release 2.4.20

The "smart" popup policy doesn't work anymore on http://www.sharereactor.com. Clicking on any
link will open popups, even if the policy is set to "deny".

Ralf
Comment 1 Datschge 2003-05-22 17:03:54 UTC
Can you create a separate testcase of it and attach it to this report, please? The site seems to be 
down for me. 
Comment 2 Ralf Holzer 2003-05-24 18:29:16 UTC
Created attachment 1639 [details]
Testcase for sharereactor.com popup code
Comment 3 Ralf Holzer 2003-06-01 17:06:44 UTC
The reason why the policy fails here, is that the JavaScript code calls a form.submit(). 
The form has a target with a non-existent frame name, so it will open a new window. 
The existing popup blocking code is not called at all.  
 
I tried to fix this myself, the patch is attached. Its a little ugly because it duplicates the 
MessageBox code from kjs_bindings.cpp. It basically checks the following things: 
 
1) Is the current page not within a frameset? -> Ask/Deny 
2) Does a frame with the form target exist somewhere? -> Allow submit 
3) Is no target specified for form? -> Allow submit 
 
I hope the code is not too messy. I've seen several pages now that use this trick 
to get around popup blockers and its really getting on my nerves.  
 
Ralf 
Comment 4 Ralf Holzer 2003-06-01 17:07:59 UTC
Created attachment 1689 [details]
Patch for kjs_html.cpp
Comment 5 Ralf Holzer 2003-06-06 18:07:00 UTC
Fixed in CVS.