Bug 58650

Summary: Smart popup policy fails on sharereactor.com
Product: [Applications] konqueror Reporter: Ralf Holzer <kdebugs>
Component: kjsAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: 4.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Testcase for sharereactor.com popup code
Patch for kjs_html.cpp

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.