2013-09-02 12:28:36 +04:00
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
2016-08-03 22:44:18 +03:00
|
|
|
// Only prevent unload on the first window close
|
|
|
|
var unloadPrevented = false;
|
2013-09-02 12:28:36 +04:00
|
|
|
window.onbeforeunload = function() {
|
2013-09-02 12:46:08 +04:00
|
|
|
setTimeout(function() {
|
2015-11-12 13:28:04 +03:00
|
|
|
require('electron').remote.getCurrentWindow().emit('onbeforeunload');
|
2013-09-02 12:46:08 +04:00
|
|
|
}, 0);
|
2016-08-03 22:44:18 +03:00
|
|
|
if (!unloadPrevented) {
|
|
|
|
unloadPrevented = true;
|
|
|
|
return false;
|
|
|
|
}
|
2013-09-02 12:28:36 +04:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|