F9 toggles sidebar even with JavaScript override




DOM: Events
17 years ago
16 years ago


(Reporter: Bill James, Assigned: Samir Gehani)


({access, embed, helpwanted})

Windows NT
access, embed, helpwanted

Firefox Tracking Flags

(Not tracked)





17 years ago
I/NET, Inc. is the creator of Webulator/400, an HTML emulation program to access 
the IBM AS/400 computer.  As part of the emulation, we have a plugin that traps 
all function key presses (F1-F24, PageUp, PageDown, etc.) to send them to the 
host for specific functionality.  We have also created a key trapper style 
JavaScript that helps with this in the new releases (0.9.3) of Mozilla.  The 
problem is that, no matter what we do, the F9 key continues to be used by the 
browser to toggle the My Sidebar functions on and off.  Is there a way (through 
HTML, JavaScript, or user configuration) that we can stop this toggle action?  
In addition, might you have other suggestions for our desired functionality?  
This does the same thing in Netscape 6.x and I have also submitted it to their 
support site.

Bill James
I/NET, Inc.

Comment 1

17 years ago
marking NEW.
Ever confirmed: true
Keywords: access, embed

Comment 2

17 years ago
Perhaps some of the information in "The Customizing Document" is of use?


Comment 3

17 years ago
if the key was bound using xbl you could.  i think for now you'd need to create 
a localization that didn't have the binding.

Comment 4

17 years ago
Thanks for the information so far -- both of these (I think) involve a rebuild 
of the browser product with specialization code.  Our users are varied enough 
that it is unrealistic for us to provide a specific version of the browser 
ourselves.  What I am looking for is something that will dynamically tell the 
browser to not use the F9 key for toggling the My Sidebar.  Ideally, something 
in the HTML (a <BODY> tag perhaps) would work the best for our purposes.  
Alternatively, some configuration setting (that the user can easily do 
themselves) would also work.

Comment 5

17 years ago
Is there possibly some additional javascript that I can include in the HTML to 
tell the browser not to perform its F9 (My Sidebar) functionality? We are 
currently using the "document.onkeydown = keyDown;", "document.onkeyup = keyUp;" 
and "document.captureEvents(Event.KEYDOWN | Event.KEYUP);" functions to capture 
all key presses and return '0' for any function key press that we find (which 
tells the browser not to do anything more with that key), but F9 continues to do 
its own thing.  For more details, you can also check out the js code at 

Comment 6

17 years ago
if you want to support mozilla, why not implement this as its own chrome 
application? then you wouldn't have this problem which in my book is a wontfix. 
html web content has no right to interfere w/ chrome application behaviors.

Your emulator would of course not include a sidebar but could have whatever 
buttons it needed.

Comment 7

17 years ago
I guess my support of Mozilla boils down to two points:
1) The javascript code that we are using seems to eat every other key available, 
including F1 (which would normally bring up Help) and F5 (which usually does a 
refresh). It seems buggy to me that the F9 key does not also follow the same 
rules - if F9 does what it always does, no matter what, then so should F1 and 
F5 (not to mention all the other keys on the keyboard).
2) My applications are available to the general Internet public and are also 
distributed to many customer servers. This makes the use of a unique chrome 
application almost impossible (unless there's some invisible way to distribute 
it on the fly that I don't know about).

Comment 8

17 years ago
yes f1 will be fixed shortly (ie you should lose it rsn) i think that's bug 

i still think chrome is your only realistic solution.


17 years ago
Summary: F9 toggle of My Sidebar even with JavaScript override → F9 toggles sidebar even with JavaScript override

Comment 9

17 years ago
-> Samri, sidebar keyboard issues
Assignee: aaronl → sgehani

Comment 10

17 years ago
You can't stop F5 from causing a reload just as you can't stop F9 from opening
the sidebar.  I don't see how this is a sidebar issue per se.  Maybe some of the
DOM folks can comment.
Assignee: sgehani → joki
Component: Keyboard Navigation → DOM Events
QA Contact: sairuh → vladimire

Comment 11

17 years ago
There are a number of folks who use Javascript to control what happens at the 
browser.  Our javascript (found at http://www.inetmi.com/support/netscape6.js) 
basically traps the keys as they are pressed and perform some action based on 
each of them.  In the example on the following link, the return value is 
It is generally understood that the "return false;" indication eats the request 
and no further browser action is taken.  This actually seems to currently be the 
case with F1, F5, and all the other keys except F9 - they all do what our code 
instructs them to do and not Help, Refresh, etc.  I can clearly understand if 
the javascript code was not in place, F9 should toggle the sidebar (just as F1 
displays Help and F5 causes a Refresh when our code is not activated) - but, 
since it is, the F9 key should be eaten by the false return and the browser 
should not react to the F9 key at all.

Comment 12

17 years ago
Actually, it does sound like sidebar is capturing the events instead of
responding on the events on the bubbling phase.

And yes, they should be able to stop this action via content.

Back to Samir, ask me for help if you need it.
Assignee: joki → sgehani


17 years ago
Priority: -- → P3
Target Milestone: --- → mozilla0.9.9

Comment 13

16 years ago
Spilling over to mozilla1.0.  Help will be appreciated.
Keywords: helpwanted
Target Milestone: mozilla0.9.9 → Future


16 years ago
Target Milestone: Future → mozilla1.0

Comment 14

16 years ago
Moving Netscape owned 0.9.9 and 1.0 bugs that don't have an nsbeta1, nsbeta1+,
topembed, topembed+, Mozilla0.9.9+ or Mozilla1.0+ keyword.  Please send any
questions or feedback about this to adt@netscape.com.  You can search for
"Moving bugs not scheduled for a project" to quickly delete this bugmail.
Target Milestone: mozilla1.0 → mozilla1.2

Comment 15

16 years ago
To cancel the default behaviour of F5, F9 etc. you should call
eventObj.preventDefault() upon the onkeypress event (see

Also see bug 139421.

Marking INVALID.
Last Resolved: 16 years ago
Resolution: --- → INVALID

Comment 16

16 years ago
You need to log in before you can comment on or make changes to this bug.