summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/test/assets/beforeunload.html
blob: 3cef6763f39f5136b604bac7e11da86cd8628d26 (plain)
1
2
3
4
5
6
7
8
9
10
<div>beforeunload demo.</div>
<script>
window.addEventListener('beforeunload', event => {
  // Chrome way.
  event.returnValue = 'Leave?';
  // Firefox way.
  event.preventDefault();
});
</script>