the web is not viable for games because browsers are unstable targets that change things constantly, breaking the games. Back when there was a stable deployment target (flash) games were everywhere.
It noticed just a few days ago that is wasn’t working on my iPhone because mobileSafari decided to stop reporting itself as safari and only as “mobile safari”.
That points to your code doing browser agent sniffing. There are much better approaches to feature detection these days, precisely because of the issue you've encountered. I can recommend https://developer.mozilla.org/en-US/docs/Learn/Tools_and_tes... as a good place to start.
It is hard to interoperate with the page, and it will keep changing on that point for a while, but that's not something that games do. For games it's all drawing on some element, what is very well defined already.