mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-11 12:33:45 +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>
|
|
|