norcross/airplane-mode — pull request #17 by johnbillion (2014-08-07 23:43:51+00:00)
Title: Blocking AJAX requests when Airplane Mode is enabled

I thought you might like to know that I've been working blocking AJAX requests when Airplane Mode is enabled.

This branch introduces some JavaScript which uses jQuery's `ajaxPrefilter` method to abort any jQuery AJAX request on the page. Currently it unconditionally aborts all AJAX requests which isn't very useful in the admin area; I'm finishing up a method for whitelisting domains complete with a filter.

One point of interest is that when calling the `abort()` method on the XHR before the request has begun means we have to manually call the `fail()` or `error()` callbacks because they don't get triggered. In case anyone wonders why we're manually calling those methods.

I'll update this PR as I work on this.