Is there any Firefox option or an extension that keeps local copies of popular JavaScript libraries such as jQuery and Mootools, and does a trick under the hood to make websites use them instead of downloading these files over and over again from different domains?


There's now a Firefox extension that does exactly what I wanted, at least for connections to CDNs:


Local emulation of Content Delivery Networks.

Decentraleyes emulates these networks locally by intercepting requests, finding the resource you need and injecting it into the environment. All of this happens instantaneously, automatically and no prior configuration is required.

| improve this answer | |

There are many versions of both of these libraries around. And just because a site references jquery.js, the file could contain anything. It could be an entirely different set of javascript.

It could also contain a standard copy of the jquery library, but with custom additions.

So in order for an extension to know whether it was safe to use the local copy rather than the one to be downloaded, it would have to first download it and compare it to the local copy.

This would make the extension useless...

| improve this answer | |
  • This is valid for generic filenames, but what about for example self-hosted Wordpress blogs, which seem to host them with a pattern and version numbers: /wp-includes/js/jquery/jquery.js?ver=1.3.2 – user33758 Oct 28 '11 at 4:38
  • 1
    This is precisely (one of) the issues that Google wants to solve with Dart - having consistent client side libaries that local code can access. Yeah, it looks like wordpress might do a special rewrite with the jquery includes to make sure a particular version is pulled in - but this would be limited to wordpress.org sites only. Non-wordpress.org wordpress installs don't pay attention to the ver= part. Look: ronsocialmedia.co.uk/wp-includes/js/jquery/jquery.js?ver=2.9.6 – Paul Oct 28 '11 at 5:00
  • There's now an extension for that: superuser.com/a/1004612/33758 – user33758 Nov 24 '15 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy