0

I am trying to close the current tab in my HTML code on Chrome but it does not seem to work. Is the server side avoiding this?

<!DOCTYPE html>
<html>

<head>
  <a href="javascript:closeWindow();"></a>
</head>

</html>

<script>
  function closeWindow() {
        window.top.close();
        close();
    }
</script>
Vika
  • 419
  • 1
  • 13
  • 3
    You can only close windows which you have opened programmatically. You cannot close the original browser window. This has nothing to do with the server side. – Rory McCrossan Oct 04 '22 at 07:48
  • so i cannot close any tabs either? That is strange but is there a way ? – Vika Oct 04 '22 at 07:51

0 Answers0