Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Seeking JS script for Firefox to disable ctl-A

    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!

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Why bother when Firefox users can easily disable that with one click?
    Just asking.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Registered User
    Join Date
    Mar 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    One click.

    Disable -> Javascript
    (webdev extension)

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

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #5
    Registered User
    Join Date
    Mar 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    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.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •