Cannot disable event when handler contains calling of window.open method

RESOLVED INCOMPLETE

Status

()

RESOLVED INCOMPLETE
13 years ago
9 years ago

People

(Reporter: mjuhos, Unassigned)

Tracking

1.5.0.x Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [CLOSEME 5-15-2010])

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.8) Gecko/20051111 Firefox/1.5

This problem occurs when is in keydown handler called window.open method.

Reproducible: Always

Steps to Reproduce:
1. Open testcase
2. press CTRL+N

Actual Results:  
Will be opened one window.

Expected Results:  
Two windows are opened.

Testcase code:
<html>
  <script>
     onkeydown = function(event) {	
        if (event.ctrlKey && event.keyCode == 78) {
           event.stopPropagation();
           window.open();
           return false;
        }	
      }
  </script>
  <body>Press CTRL+N</body>
</html>
(Reporter)

Comment 1

13 years ago
Created attachment 205733 [details]
key down problem testcase
(Reporter)

Comment 2

13 years ago
Workaround:
Call method window.open by setTimeout method.

Replace row in testcase:
  window.open();
to row:
  setTimeout("window.open();", 0);
Are the "Expected" and "Actual" results in your description correct? I get no window opened with your testcase, since the event handler returns false.
(Reporter)

Comment 4

13 years ago
Sory I confused "Actual" and "Expected" results.

Actual Results:  
Two windows are opened.
(One window which is opened is empty window with home page, and second window is window opened by window.open method.)

Expected Results:  
One window will be opened (window opened by window.open method).


This bug was reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.3 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 5-15-2010]
Version: unspecified → 1.5.0.x Branch
No reply, INCOMPLETE. Please retest with Firefox 3.6.x or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.