puppeteer/test/assets/beforeunload.html

11 lines
198 B
HTML

<div>beforeunload demo.</div>
<script>
window.addEventListener('beforeunload', event => {
// Chrome way.
event.returnValue = 'Leave?';
// Firefox way.
event.preventDefault();
});
</script>