title: Pressing Escape under Firefox kills my Ajax requests. I'd like to prevent this
body: <p>I'm developing a web application which requires long-running Ajax requests. Unfortunately, under Firefox, pressing <kbd>Escape</kbd> during a request has the drawback of killing the request and any information it was holding. This is rather annoying, as this can lead to all sorts of nasty complications if this happens at the wrong time. Therefore, I would like to deactivate this feature.</p>
  <p>My first reflex was to intercept keypresses at the boundaries of &lt;body&gt;, to ensure that they would not reach the window. For this purpose, I installed a [keypress] event handler, just for events whose [keyChar] is 27, and had it invoke [stopPropagation] and [preventDefault]. And for a time, it looked like this was working.</p>
  <p>Then, I realized that it wouldn't work when the user hadn't clicked anywhere on the window, as &lt;body&gt; event handlers never received the event. I tried to attach my handler to &lt;document&gt; or &lt;window&gt; to no avail, so I eventually ended up adding a [load] event handler and had it force focus to &lt;body&gt;. And for a time, it looked like this was working.</p>
  <p>Then, I realized that when the user was editing an &lt;input&gt;, for some reason, once again, the &lt;body&gt;, &lt;document&gt; or &lt;window&gt; event handler never seem to receive the event. So, I added yet another [keypress] handler, intercepting with [preventDefault] on the &lt;input&gt; when the [keyChar] is 27.</p>
  <p>For the moment, it looks like it's working. However, with the history of this bug in my application, I'm a tad pessimistic.</p>
  <p>So, I'm wondering if there's a better -- and reproducible -- method. Recall that the bug seems to appear only in Firefox, so I'm quite willing to take a Firefox-only approach here.</p>