I have a webpage with a master script that connects, via AJAX, to a remote server and downloads unsecure JS scripts (let’s call them slave scripts), to be executed lately on the client. I would like to limit the Internet access slave scripts have; e.g. they can communicate just with the remote server.
Do you have any idea of how can I achieve this?
Thanks,
Laurențiu Dascălu
You can’t.
JavaScript AJAX calls will have access to whatever the browser has access to.
Your best bet would be attempt to create a third JavaScript component to proxy the slave script calls through. That component would be responsible for ensuring that the slave scripts weren’t calling any URLs that they shouldn’t be.
The downside, of course, is that anybody can download and modify all of your scripts anyway…which means that any proxy would be easy to overcome.