Spotted something similar here.. https://github.com/addyosmani/basket.js
I'm uncertain to the JS security level when doing stuff like this. It doesn't seem like something browsers would allow (the manipulation of javascript files in this way)
Good work.
Basket.js is one of the projects that motivated me to start inscribe.js. Basket.js caches only scripts. But inscribe.js stores whole pages, along with assets individually. With that, it then renders the page from the localStorage.