mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
12 lines
214 B
HTML
12 lines
214 B
HTML
<!DOCTYPE html>
|
|
<div>beforeunload demo.</div>
|
|
<script>
|
|
window.addEventListener('beforeunload', event => {
|
|
// Chrome way.
|
|
event.returnValue = 'Leave?';
|
|
// Firefox way.
|
|
event.preventDefault();
|
|
});
|
|
</script>
|
|
|