Let’s start with the demo: an exported Arcade game that opens a new browser tab.
In general, Arcade games are completely sandboxed… So how can we open a new tab? Let’s take a look.
The control.simmessages is a new API added in Arcade to support the JACDAC simulator… but you can use it too in GitHub Pages.
In this demo, the game calls a “open url” function
That function sends a “web open url” message over control.simmessages.
and we’ve registered a function handler for the “web” channel
So eventually, through a few layers your message from the MakeCode Arcade game routes itself to the handler that calls window.open.