module.exports = require('xmlhttprequest').XMLHttpRequest;

module.exports = typeof window !== 'undefined' && window.XMLHttpRequest || require('xmlhttprequest').XMLHttpRequest;

Fix XHR in Electron / nw.js