spec/fixtures/pages/beforeunload-false.html (13 lines of code) (raw):
<html>
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
setTimeout(function() {
var ipcRenderer = require('electron').ipcRenderer;
ipcRenderer.sendToHost('onbeforeunload');
}, 0);
return false;
}
</script>
</body>
</html>