Re: [XHR] Redirects

On Tue, 31 Aug 2010 22:51:19 +0200, Darin Fisher <darin@chromium.org>  
wrote:
> If instead, we had an API for auditing redirects (perhaps an "onredirect"
> event), then we could let developers handle that event and call
> preventDefault if they want to stop redirect processing.  Otherwise, the
> redirect would be processed normally.  The result being that application
> authors would be guided away from following redirects manually, and hence
> they would avoid the problems I've described above.

This does not work for synchronous requests in a worker. If we are okay  
with that it seems an acceptable alternative. However, redirects are  
processed before the object reaches HEADERS_RECEIVED (as otherwise it  
would reach that several times) so HTTP headers et cetera are not  
available yet. Given that, and given that you want that information, you  
would always invoke preventDefault(), defeating the purpose of having an  
event.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Wednesday, 1 September 2010 06:26:49 UTC