I see the issue you’re having. I haven’t been able to figure out how to solve it, but I’ve passed it up the chain & hopefully somebody can get back to you in the next day or two.
Hey @kurmasz! Sorry to say - you won’t be able to access the document object within Game Lab.
If you’d like to dive deeper into connecting your games to the browser and adding things like events, I’d recommend switching over to p5js and their play library.