mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
11 lines
209 B
HTML
11 lines
209 B
HTML
<div>beforeunload demo.</div>
|
|
<script>
|
|
window.addEventListener('beforeunload', event => {
|
|
// Chromium & WebKit way.
|
|
event.returnValue = 'Leave?';
|
|
// Firefox way.
|
|
event.preventDefault();
|
|
});
|
|
</script>
|
|
|