electron/spec-main/fixtures/api/beforeunload-false-prevent3.html

18 lines
444 B
HTML
Raw Normal View History

2017-04-25 23:14:34 +00:00
<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);
2017-04-25 23:14:34 +00:00
return false;
})
2017-04-25 23:14:34 +00:00
}
</script>
</body>
</html>