Change window.XMLHttpRequest typeof check to look for not-undefined, instead of function. Now detects XHR on Safari properly.