title: Intercept browser requests for resources
body: <p>Is there any way in which one could load an initial script (a file at the top of the page) that then attempts to intercept all other requests for resources (scripts, css, images, etc.) as the page continues to load?</p>
  
  <p>The purpose of this interception is to instead serve the files from cache (localStorage, indexedDB, other) or even from a remote peer via webrtc in an agnostic manner that does not depend on how the application/page is put together.</p>
  
  <p>I'm aware of cache manifest/offline approaches but the point here is to grab the requested resource and proxy it from a location of choice.</p>