thanks for the feedback
the mouse locking function is called when the game starts. maybe when starting the game within the web browser it's not on system focus (as if it was minimized) preventing the lock.