How to close window in motd file?

I have a problem with closing the window. I’m writing a motd file for cs1.6, the task is to launch the gif in the second window, which opens after clicking on the link. Everything opens, the gif plays, the window can be closed, but it does not close automatically after a timeout. In the classic browser it closes and everything works correctly, one CS does not want to skip my script. Help please

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script>
        function closeWindow(gifWindow){
            if (gifWindow) {
                gifWindow.close();
            }
        }
        function openGifWindow() {
            var gifWindow = window.open("video.gif", "GifWindow", "width=400,height=400");
            setTimeout(function() { closeWindow(gifWindow); }, 1000);
        }
    </script>
</head>
<body>
    <a href="#" onclick="openGifWindow(); return false;">Открыть гифку</a>
</body>
</html>