electron/spec-main/fixtures/api/beforeunload-false-prevent3.html
2020-04-16 15:22:39 -07:00

17 lines
444 B
HTML

<html>
<body>
<script type="text/javascript" charset="utf-8">
function preventNextBeforeUnload() {
window.addEventListener('beforeunload', function handler(e) {
e.preventDefault();
e.returnValue = '';
window.removeEventListener('beforeunload', handler)
setTimeout(function() {
require('electron').ipcRenderer.sendSync('onbeforeunload')
}, 0);
return false;
})
}
</script>
</body>
</html>