As far as I'm aware that's not an option yet but I wouldn't mind if it were. I don't know how difficult that is to implement but it would be a nice feature in the future.
Turn off chat window while watching a game?

Figures. I swear if I could be director of coding for a month, I could clean up both the desktop and mobile platforms for this site. 🧐

Using Ublock Origin I just removed some part of the chat box. Now I can finally enjoy the games in peace.

yeah omg it sux so bad, so many spam and toxic stuff I can't believe chesscom don't have a feature to turn this off terrible

You can use Focus mode. Either click the option for it (it's immediately below the settings icon next to the chessboard), or press your Z key to toggle it. It basically hides everything besides the board, players, timers, and the back/forward buttons.
Alternatively you can remove it yourself via the browser or an extension. I like to right-click it, go into Inspect Element, and delete the following code off the page:
<div class="resizable-chat-area-content">
Do keep in mind this will disable the box in its entirety, though. Including the automated game-related messages such as who won and the like. This method is per each individual page.
If anything goes wrong or you want it back you just refresh the page or open it in a new tab (so that you can go back to the "modified" one if need be).
So I'm on desktop using Firefox, and I'd like to turn the chat window off while watching top GMs play. Maybe I'm blind, but I cannot find where to turn JUST the chat window off. I still want to watch the games, just without the annoying spam flickering across the right side of the screen. Thanks!