Server IP : 162.213.251.212 / Your IP : 3.147.13.194 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/allssztx/www/easybuyer/node_modules/sockjs-client/lib/utils/ |
Upload File : |
'use strict'; var random = require('./random'); var onUnload = {} , afterUnload = false // detect google chrome packaged apps because they don't allow the 'unload' event , isChromePackagedApp = global.chrome && global.chrome.app && global.chrome.app.runtime ; module.exports = { attachEvent: function(event, listener) { if (typeof global.addEventListener !== 'undefined') { global.addEventListener(event, listener, false); } else if (global.document && global.attachEvent) { // IE quirks. // According to: http://stevesouders.com/misc/test-postmessage.php // the message gets delivered only to 'document', not 'window'. global.document.attachEvent('on' + event, listener); // I get 'window' for ie8. global.attachEvent('on' + event, listener); } } , detachEvent: function(event, listener) { if (typeof global.addEventListener !== 'undefined') { global.removeEventListener(event, listener, false); } else if (global.document && global.detachEvent) { global.document.detachEvent('on' + event, listener); global.detachEvent('on' + event, listener); } } , unloadAdd: function(listener) { if (isChromePackagedApp) { return null; } var ref = random.string(8); onUnload[ref] = listener; if (afterUnload) { setTimeout(this.triggerUnloadCallbacks, 0); } return ref; } , unloadDel: function(ref) { if (ref in onUnload) { delete onUnload[ref]; } } , triggerUnloadCallbacks: function() { for (var ref in onUnload) { onUnload[ref](); delete onUnload[ref]; } } }; var unloadTriggered = function() { if (afterUnload) { return; } afterUnload = true; module.exports.triggerUnloadCallbacks(); }; // 'unload' alone is not reliable in opera within an iframe, but we // can't use `beforeunload` as IE fires it on javascript: links. if (!isChromePackagedApp) { module.exports.attachEvent('unload', unloadTriggered); }