Browse Source

Fixes supportsMozChunked for node.js

Yury Delendik 10 years ago
parent
commit
20b46aaf88
  1. 7
      src/core/network.js

7
src/core/network.js

@ -73,18 +73,15 @@ var NetworkManager = (function NetworkManagerClosure() {
//#if !(CHROME || FIREFOX || MOZCENTRAL) //#if !(CHROME || FIREFOX || MOZCENTRAL)
var supportsMozChunked = (function supportsMozChunkedClosure() { var supportsMozChunked = (function supportsMozChunkedClosure() {
var x = new XMLHttpRequest();
try { try {
var x = new XMLHttpRequest();
// Firefox 37- required .open() to be called before setting responseType. // Firefox 37- required .open() to be called before setting responseType.
// https://bugzilla.mozilla.org/show_bug.cgi?id=707484 // https://bugzilla.mozilla.org/show_bug.cgi?id=707484
x.open('GET', 'https://example.com');
} catch (e) {
// Even though the URL is not visited, .open() could fail if the URL is // Even though the URL is not visited, .open() could fail if the URL is
// blocked, e.g. via the connect-src CSP directive or the NoScript addon. // blocked, e.g. via the connect-src CSP directive or the NoScript addon.
// When this error occurs, this feature detection method will mistakenly // When this error occurs, this feature detection method will mistakenly
// report that moz-chunked-arraybuffer is not supported in Firefox 37-. // report that moz-chunked-arraybuffer is not supported in Firefox 37-.
} x.open('GET', 'https://example.com');
try {
x.responseType = 'moz-chunked-arraybuffer'; x.responseType = 'moz-chunked-arraybuffer';
return x.responseType === 'moz-chunked-arraybuffer'; return x.responseType === 'moz-chunked-arraybuffer';
} catch (e) { } catch (e) {

Loading…
Cancel
Save