We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 484e3ec commit f62fca4Copy full SHA for f62fca4
lib/transports/polling-xhr.js
@@ -401,7 +401,8 @@ if (typeof document !== 'undefined') {
401
if (typeof attachEvent === 'function') {
402
attachEvent('onunload', unloadHandler);
403
} else if (typeof addEventListener === 'function') {
404
- addEventListener('beforeunload', unloadHandler, false);
+ var terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload';
405
+ addEventListener(terminationEvent, unloadHandler, false);
406
}
407
408
0 commit comments