diff --git a/lib/util.js b/lib/util.js index 14f94fbb..3edc2c0f 100644 --- a/lib/util.js +++ b/lib/util.js @@ -202,10 +202,10 @@ exports.ua.ios6 = exports.ua.ios && /OS 6_/.test(navigator.userAgent); */ exports.request = function request (xdomain) { - if ('undefined' == typeof window) { + try { var _XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; return new _XMLHttpRequest(); - } + } catch (e) {} if (xdomain && 'undefined' != typeof XDomainRequest && !exports.ua.hasCORS) { return new XDomainRequest();