Question: Is it possible to prevent the browser from following redirects when sending XMLHttpRequest-s (i.e. to get the redirect status code back and handle it myself)?

Answer: 
Not according to [the W3C standard for the XMLHttpRequest object](http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#infrastructure-for-the-send%28%29-method) (emphasis added):

> 
> If the response is an HTTP redirect:
> 
> 
> 
> > 
> > If the origin of the URL conveyed by the Location header is same origin
> >  with the XMLHttpRequest origin and the
> >  redirect does not violate infinite
> >  loop precautions, **transparently
> >  follow the redirect** while observing
> >  the same-origin request event rules.
> > 
> > 
> > 
> 
> 
> 

They were [considering](http://www.w3.org/TR/2008/WD-XMLHttpRequest-20080415/#notcovered) it for a future release:

> 
> This specification does not include
>  the following features which are being
>  considered for a future version of
>  this specification:
> 
> 
> * Property to disable following redirects;
> 
> 
> 

but the [latest](http://www.w3.org/TR/XMLHttpRequest/) specification no longer mentions this.
You can use `responseURL` property to get the redirect destination or check whether the response was ultimately fetched from a location you accept. 

This of course means the result is fetched anyway, but at least you can get the necessary info about the redirect destination and for example detect conditions when you would like to discard the response.