LearnBoost/engine.io-client — pull request #283 by lpinca (2014-04-06 14:10:51+00:00)
Title: polling-xhr: abort the request when the window is unloaded

It seems that the cleanup originally planned only for old versions of IE is also needed for IE10/11.

To show the issue i have started a basic engine.io server here http://mezzase.ga/. The code of the server is this:
```javascript
var fs = require('fs')
, http = require('http');

var server = http.createServer(function (req, res) {
if (req.url === '/client.js') {
res.setHeader('Content-Type', 'application/javascript');
fs.createReadStream(__dirname + '/client.js').pipe(res);
return;
}
if (req.url === '/engine.io.js') {
res.setHeader('Content-Type', 'application/javascript');
fs.createReadStream(__dirname + '/engine.io.js').pipe(res);
return;
}
res.setHeader('Content-Type', 'text/html');
fs.createReadStream(__dirname + '/index.html').pipe(res);
});

var io = require('engine.io').attach(server);

io.on('connection', function (socket) {
socket.send('bar');
});

server.listen(80, function () {
console.log('server listening on port 80');
});
```
Then i connect to the server using IE11 from another domain. To test this i've put this `index.html` in my public dropbox folder.
```html

```
You can find it here http://dl.dropboxusercontent.com/u/58444696/index.html.
If you open that url in IE11 and start refreshing the page at some point you will get errors like this:

![about-blank](https://cloud.githubusercontent.com/assets/1443911/2625400/fce7fb34-bd93-11e3-9d14-aabd66e32f75.png)

The proposed patch fixes the issue ensuring that the pending opened request is closed when the window is unloaded. This is done for all browsers, not only IE because if the cleanup is done for all browsers it also fixes issue #282.