Same for me in firefox. Even with the website closed I get a popup of "dmitrybrant.com controls your cursor" from time to time or if i hover over the top of the URL bar. Visiting the website again and explicitely pressing Esc, then closing the page worked to get rid of the message.
Sounds like an extraordinary bug worth reporting to Firefox! A page is not supposed be able to hold the cursor when it is not in the foreground.
I'm using Firefox, can't re-produce. How did you navigate away without first freeing your cursor? I just pressed escape like the browser message said to, but then obviously at that point the cursor was already free so I couldn't test whether navigating away would free it. Closing the tab with Ctrl+W does also free the cursor.
Same thing happened to me. In Firefox. Stumbled over here as I was looking for more info.