I'm coding a js API that is going to be used by external customers and executed by my customers in their web browsers.
As this is potentially harmful for my web users (security holes etc.), I'd like to allow or disallow access to, at least, the document global variable and others like the XMLHTTPRequest API.
How can I do this?
EDIT:
I was thinking on doing things like document = null on a wrapper to the functions the API users write, but it doesn't work. Also, using this kind of approach it is difficult to be thorough as there are too many workarounds and too many possibilities to take in account all of them.