Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

209 B
Raw Blame
<div>beforeunload demo.</div>
<script>
window.addEventListener('beforeunload', event => {
  // Chromium & WebKit way.
  event.returnValue = 'Leave?';
  // Firefox way.
  event.preventDefault();
});
</script>