Fix xhr.responseType set before xhr.open

Not a problem with Chrome, but in Firefox setting it before doesn't work.
See: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/HTML_in_XMLHttpRequest#Usage