I’m working on a project that runs multiple HTML5 “apps.” There are tight bandwidth constraints, so we have libraries that apps may use to send and receive data over the network. We replace common
window scoped objects like
XMLHttpRequet with proxies that forward traffic over our managed connection.
However, “apps” can always trigger a Chrome ResourceLoader by, say, dropping an image on the DOM with a http://… source.
I would like to either intercept all network traffic, or disable it entirely for a window and force it to use its proxies.
My first attempt has been trying to intercept the protocol. I get the following results:
Error: Scheme does not exist
Error: The scheme is already registered
Error: The scheme has not been registered
In order to use atom-shell, the only thing I can figure at the moment is to have a parent process fork it, unshare the networking namespace, and leverage some kind of IPC between the two.
I’ve tried hooking in to DOM events to try to catch elements that would cause a ResourceLoader to call out to the network, but that didn’t seem reliable at all.
Anything I’ve overlooked?