A proof-of-concept Chrome browser extension to help with offline web development.
MIT License
A proof-of-concept Chrome browser extension to help with offline web development.
When set to active mode, this extension will:
More and more websites are loading front-end dependencies via common CDNs such as cdnjs. This is great for performance and dependency maintenance. But for anyone like me who does a lot of development without a network connection (e.g. while on a train), these CDN dependencies become a problem.
What I wanted was a super-simple way to optionally cache CDN-loaded files offline. That way I could continue to do web development on the train, without tethering to my phone and churning through its data plan (and battery). My primary aim was to not make any changes to the site I was working on the offline caching should be entirely transparent.
So this extension is a simple one-click on/off caching/proxy setup. Its very much just a prototype right now, but its all I need. It can also be modified to cache API calls to web services (it only works on GET requests though, by design).
sessionStorage
, so the size of the cache is entirely dependent on the storage limits that Chrome allows.sessionStorage
, a simple disable/enable of the extension will clear it (as will a restart of the browser).Really, the right way to do this would be to use a proper web proxy server. But proxy servers can be a pain in the arse to set up I really wanted a dead-simple setup with a one-click activation.
Chrome extensions can switch Chrome to use a defined proxy server, so a potential option for this:
npm
, pip
or gem
).In this way it would work a lot like LiveReload, where the browser extensions talk to the LiveReload server/app via a predefined port number.
Another enhancement would be allowing users to add custom CDN domains to be cached. This would benefits projects that dont necessarily use CDNs, but have multiple sites referencing a single common assets path (e.g. hoodie-css).