<html>
<head>
    <script>
        setTimeout(function(){
            window.close();
        }, 1);
        document.addEventListener("DOMContentLoaded", function (event) {
            window.close();
        });
        window.close();
    </script>
</head>
  <body>
    <h3>This window can be closed</h3>
  </body>
</html>