Webchat - customer closed window

Thank you ahead of time for any answers on this.

I have recently inherited supporting our webchat service that connects agents to customers. What I am being asked is if we can tell if a customer closed a webchat window or an agent closed it. Can this even be found out?

Thanks

J