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