I have my game hosted in an iframe inside a page. The parent page needs to pass a token to the game. I have the parent page send a post message to the gamewindow. Inside construct, would this code be an eventscript made inside the eventsheet or is it a browser javascript action or is it a script to be added to the scripts folder under main.js ?
window.addEventListener("message", (event) => {
if (event.origin !== "http://example.org:8080")
return;
// ...
}, false);
Also, since the game runs in a worker, would window.addeventlistener work?