Open Bug 257870 Opened 17 years ago Updated 3 years ago

Keypress not recognised as user event for popup blocker


(Core :: DOM: Events, defect, P3)






(Reporter: gyoung, Unassigned)




User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3

When a popup window is triggered after the user presses a key (say in an input
textbox) the popup blocker blocks the popup, even though it was a result of a
user action.

Reproducible: Always
Steps to Reproduce:
1. View page - window.onload popup blocked alert shown
2. Click in the input text box
3. Press any key - input.keypress popup blocked alert shown
Actual Results:  
See above.

Expected Results:  
The popup should be allowed after pressing a key in the input box.  In the
example, a popup window is shown and an alert indicating the popup was allowed
should be displayed.

This is a problem for web application developers who wish to display popups
based on specific key presses (such as the tab key or some other key combo).  IE
(sp2) and Safari both accept keypress as a valid user event for their popup
blocking implementation.
jst, wanna just dup that to the bug you were working on earlier today?
IE on SP2 doesn't permit a popup from a keypress event here (default settings),
except for the enter key, just like Mozilla does. Can you please re-test with
IE, and make sure you haven't configured it to specifically allow popups from
keypress events? Marking WONTFIX, reopen if this really should change.
Closed: 17 years ago
Resolution: --- → WONTFIX
Resolution: WONTFIX → ---
Thanks for your prompt review and feedback - I have just confirmed that you are
right - I was testing on a page hosted on localhost, which is allowed by default
under IE - thus my comments.  I would still like to see this changed, but
understand if this is not considered something requiring change.
*** Bug 304965 has been marked as a duplicate of this bug. ***
I've just encountered this issue with the Webmail application that I'm developing.  See for a demo.  If you select a message you can click on "reply", "forward" etc. and it correctly pops up a message composition window. But if you press "r" or "f", which are detected using document.onkeypress, it shows the popup blocker message.

I'd like to imagine that there is some way that keypresses could be allowed to open windows without letting through nasty popups.  If this has been discussed elsewhere, please point me in the right direction - thanks.
Assignee: events → nobody
QA Contact: ian → events
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.