Gazebo_simulation-Frontend/node_modules/.cache/babel-loader/0b01bd97fbf660c10758933c65f47dce.json
2020-12-31 20:18:50 +00:00

1 line
2.2 KiB
JSON

{"ast":null,"code":"'use strict';\n\nvar random = require('./random');\n\nvar onUnload = {},\n afterUnload = false // detect google chrome packaged apps because they don't allow the 'unload' event\n,\n isChromePackagedApp = global.chrome && global.chrome.app && global.chrome.app.runtime;\nmodule.exports = {\n attachEvent: function attachEvent(event, listener) {\n if (typeof global.addEventListener !== 'undefined') {\n global.addEventListener(event, listener, false);\n } else if (global.document && global.attachEvent) {\n // IE quirks.\n // According to: http://stevesouders.com/misc/test-postmessage.php\n // the message gets delivered only to 'document', not 'window'.\n global.document.attachEvent('on' + event, listener); // I get 'window' for ie8.\n\n global.attachEvent('on' + event, listener);\n }\n },\n detachEvent: function detachEvent(event, listener) {\n if (typeof global.addEventListener !== 'undefined') {\n global.removeEventListener(event, listener, false);\n } else if (global.document && global.detachEvent) {\n global.document.detachEvent('on' + event, listener);\n global.detachEvent('on' + event, listener);\n }\n },\n unloadAdd: function unloadAdd(listener) {\n if (isChromePackagedApp) {\n return null;\n }\n\n var ref = random.string(8);\n onUnload[ref] = listener;\n\n if (afterUnload) {\n setTimeout(this.triggerUnloadCallbacks, 0);\n }\n\n return ref;\n },\n unloadDel: function unloadDel(ref) {\n if (ref in onUnload) {\n delete onUnload[ref];\n }\n },\n triggerUnloadCallbacks: function triggerUnloadCallbacks() {\n for (var ref in onUnload) {\n onUnload[ref]();\n delete onUnload[ref];\n }\n }\n};\n\nvar unloadTriggered = function unloadTriggered() {\n if (afterUnload) {\n return;\n }\n\n afterUnload = true;\n module.exports.triggerUnloadCallbacks();\n}; // 'unload' alone is not reliable in opera within an iframe, but we\n// can't use `beforeunload` as IE fires it on javascript: links.\n\n\nif (!isChromePackagedApp) {\n module.exports.attachEvent('unload', unloadTriggered);\n}","map":null,"metadata":{},"sourceType":"script"}