Disabling Firefox keyboard shortcuts with JavaScript

First off, let me just say I feel really stupid for posting this. It seems like I stumbled onto something for the first time that should be common knowledge for a JavaScript developer.  However, I am still making the post because I find this to be rather strange.  Using the event ‘preventDefault’ method, you can completely disable Firefox’s built in keyboard shortcuts.  If you click on the following js bookmarklet:

ruin my browser!

You won’t be able to pop firebug up with f12, ctrl+t yourself a new tab, get yourself a fresh version of the page with f5, and you won’t even be able to view the source. When I ran into this for the first time, I thought my computer was fucked up.

Apparently, this is also just Firefox. I just tested it in IE and Chrome, and it appears to do nothing. Is this a XUL thing?

Does anyone else find this to be strange or annoying? Is this surprising or am I stupid? It just seems like this shouldn’t happen.

trackback

Tags: , , , , 6 responses »
  1. nocash's gravatar

    Shuts down my keys as well. I always thought this level of user annoyance was reserved for sites that use Flash.

  2. me's gravatar

    does not work anymore. too bad, that would have fixed my browser… i want those keyboard shortcuts disabled all of the time. they interfere with other shortcuts on my Mac, like the one for Megazoomer

  3. atom's gravatar

    Still appears to work in linux and windows, i suspect that for whatever reason macs aren’t good enough to fail properly.

  4. SamGoody's gravatar

    Actually, this is good. Just used wrong.

    I have developed a wysiwyg editor, and need to be able to respond to keyboard shortcuts. Once javascript must give me that level of control (and in all browsers) there is no reason to make it difficult to setup.

    Mootools has all this built in: there is no difference between overiding the ctrl+b or overiding all keyboard shortcuts.

  5. verne miller's gravatar
    verne miller Says:

    I clicked on the bookmarklet.It worked but how do I get the shortcuts back?

  6. atom's gravatar

    you could not have typed that comment if your keys were disabled. i suspect you are confused.

Leave a Reply

ok to use:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

bonus!

If you want to post code, you can use:

<pre lang="[language]">[code]</pre>

Where [language] is a valid geshi language type, and where [code] is your code.

Google chrome: a first impressions review.

I like it a lot.

Keeping it non-technical, because someone else will rant about that stuff in more detail than I am willing to or can.

Stuff I am liking:

  • Very fast
  • It is very roomy feeling, not much “chrome” as it were.
  • I don’t have to relearn shortcuts, they are almost all FFish
  • I can open JavaScript bookmarklets in new tabs (this was not the case for FF as of version 3)
  • Searching is awesome, with a bit of setup, its very few keystrokes, like: “w jelly” to search wikipedia for jelly
  • View source pops up in a tab
  • The animations are cute and informative without being annoying
  • the launch page is handy (although Opera has had this for some time)
  • Built in “appability” (make one tab appear as an application window, for something like google docs)
  • Built in tab restore (I constantly close a tab and then realize I want it back)
  • Built in and fairly complete dom inspector, console, and JS debugger
  • The process manager is awesome.  Even when stuff gets out of hand, you can assumably fix it without losing your whole session
  • The find dialogue is great, however it will take a moment or two to adjust to top-right vs bottom-left

Lets get critical*:

  • The inspector, while nice, doesn’t allow me to change stuff on the fly like firebug does
  • There appear to be some JS animation / transparent png issues
  • I can’t do much in the way of scrolling
  • I don’t think the form elements displayed are as attractive as Firefox’s (on Vista)
  • As far as I have seen, there does not appear to be a way for me to view and interact with ajax requests
At least for now, it will be my default browser, however I will still be using Firefox for development purposes. I want chrome to succeed, and to do this it will need to be embraced by and passionately work with the open source crowd.  So far they appear to be off to a cracking good start.  I will follow up with more later when I have used it extensively.

* please note that I am not an experienced webkit-based browser user.

trackback

Tags: , , , , , 5 responses »
  1. nocash's gravatar

    I’ve more-or-less come to the same conclusion: Chrome for standard browsing, FF for development. That’s what I’m going to try for, anyway. Chrome’s lack of addons may push be back to FF in the short-term, but I’m coming up with alternatives to the ones that I’m most used to.

  2. williac's gravatar

    I think I’m in love already.

    No major hitches so far. The learning curve is practically nonexistent. It even has spellcheck.

  3. savageaphid's gravatar
    savageaphid Says:

    I had a good time with Chrome. It was quick and clean. I expect this app to move to the top handful of applications running on a regular basis pretty quickly.

  4. Timothy Hatcher's gravatar

    If you like Chrome’s stripped down Web Inspector, you will love the original, full featured version in the WebKit nightlies. (Including double clicking to edit CSS/DOM.) Cheers!

  5. atom's gravatar

    @Timothy

    What I love is Firebug. Let me know when you have it topped.

Leave a Reply

ok to use:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

bonus!

If you want to post code, you can use:

<pre lang="[language]">[code]</pre>

Where [language] is a valid geshi language type, and where [code] is your code.

Firefox 3 release date / download party day!

firefox 3 release date announced

I have it on good authority (the internet’s) that firefox 3 will be released on June 17th!

Be sure to get involved by pledging to download on dday.

trackback

Tags: , no responses »

Leave a Reply

ok to use:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

bonus!

If you want to post code, you can use:

<pre lang="[language]">[code]</pre>

Where [language] is a valid geshi language type, and where [code] is your code.