...

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



newbie25
09-25-2005, 06: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!

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

newbie25
09-26-2005, 02: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?

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

Disable -> Javascript
(webdev extension)

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

newbie25
09-26-2005, 07: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.

nikkiH
09-26-2005, 07: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum