chromium/third_party/blink/renderer/core/testing/data/close-on-pagehide.html

<!DOCTYPE html>
<body>
<script>window.onpagehide = () => { window.close(); } </script>
</body>