View Full Version : Seeking JS script for Firefox to disable ctl-A

09-25-2005, 07:27 PM
Does anyone know where I can find a piece of Javascript code to disable a ctrl-A entered while a user is viewing a page in Forefox?

I have some code to do that for MSIE, but it does not work for Firefox. Apparently Javascript in firefox works differently from the way it does in MSIE. I've spent about an hour searching all over the web, but I can't find anything.
Would appreciate any help!

09-26-2005, 03:02 PM
Why bother when Firefox users can easily disable that with one click?
Just asking.

09-26-2005, 03:41 PM
I have a number of reasons for wanting to do it; one of them is curiosity.

What's the one keystroke a Firefox user would use to get around it?

09-26-2005, 07:01 PM
One click. ;)

Disable -> Javascript
(webdev extension)

In Avant Browser, also one click. No extension needed.
Tools->Disable script

09-26-2005, 08:29 PM
That's what I suspected.

Still, as an abstract question, suppose I wanted to disable certain keyboard entries using Javascript. How would I do that? I know about scancodes, and I have some code that works--it just doesn't work in Firefox.

09-26-2005, 08:45 PM
Well, as an abstraction (not tested), if I wanted to disable control+A, I'd add an event listener to the whole page, catch keypress, check keycode, and return false for control+A.
Not sure if that would work, though.