Make games with Superpowers — The extensible, collaborative HTML5 2D+3D game maker

Using the DOM APIs

Why doesn't Superpowers expose the DOM APIs by default?

The DOM APIs are the standard functions and objects available to scripts in a Web browser. They include things like the window or document objects, XMLHttpRequest and so much more.

We've decided to shield Superpowers games from all that stuff by default for two reasons:

How to use them anyway

The good news is, you can still choose to access the DOM anyway. You could just do a one-off declare var window; at the top of your first script and then use the APIs untyped with new window.XMLHttpRequest(...); for instance.

If you use it a lot though, having proper type checks would be useful. Thankfully, Florent Poujol has written a Superpowers DOM plugin that will expose all the typed APIs for you.