2013-09-02 08:28:36 +00:00
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
2016-08-03 19:44:18 +00:00
|
|
|
// Only prevent unload on the first window close
|
|
|
|
var unloadPrevented = false;
|
2013-09-02 08:28:36 +00:00
|
|
|
window.onbeforeunload = function() {
|
2013-09-02 08:46:08 +00:00
|
|
|
setTimeout(function() {
|
2019-11-14 22:09:03 +00:00
|
|
|
require('electron').ipcRenderer.sendSync('onbeforeunload');
|
2013-09-02 08:46:08 +00:00
|
|
|
}, 0);
|
2016-08-03 19:44:18 +00:00
|
|
|
if (!unloadPrevented) {
|
|
|
|
unloadPrevented = true;
|
|
|
|
return false;
|
|
|
|
}
|
2013-09-02 08:28:36 +00:00
|
|
|
}
|
2019-07-02 20:48:58 +00:00
|
|
|
// unload events don't get run unless load events have run.
|
|
|
|
window.onload = () => window.close()
|
2013-09-02 08:28:36 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|