playwright/test/assets/beforeunload.html
2019-11-19 10:58:15 -08:00

11 lines
198 B
HTML

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